Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'on' of undefined #100

Open
nissenyeh opened this issue Apr 14, 2020 · 0 comments
Open

Cannot read property 'on' of undefined #100

nissenyeh opened this issue Apr 14, 2020 · 0 comments

Comments

@nissenyeh
Copy link

nissenyeh commented Apr 14, 2020

here is my code

  const fileName = req.files.voice.name
  const originFilePath = './upload/' + fileName + '.mp3'
  const encodeFilePath = './upload/after-' + fileName + '.mp3'
  
  console.log(req.files.voice.name, req.files.voice.size);

  req.files.voice.mv(originFilePath,function(err){ 
    if(err)console.log(err)
    const encoder = new Lame({ output: encodeFilePath }).setFile(originFilePath); 
    encoder.decode()
    .then(() => {
     ...
  })

1|app | TypeError: Cannot read property 'on' of undefined
1|app | at Lame.execProgress (/srv/voice-diagnosis-formal/node_modules/node-lame/lib/build/Lame.js:272:25)
1|app | at Lame.progress (/srv/voice-diagnosis-formal/node_modules/node-lame/lib/build/Lame.js:145:25)
1|app | at Lame.decode (/srv/voice-diagnosis-formal/node_modules/node-lame/lib/build/Lame.js:107:21)
1|app | at /srv/voice-diagnosis-formal/routes/voice.js:27:13
1|app | at err (/srv/voice-diagnosis-formal/node_modules/express-fileupload/lib/utilities.js:57:57)
1|app | at WriteStream.fstream.on (/srv/voice-diagnosis-formal/node_modules/express-fileupload/lib/utilities.js:186:29)
1|app | at WriteStream.emit (events.js:182:13)
1|app | at lazyFs.close (internal/fs/streams.js:208:14)
1|app | at FSReqWrap.oncomplete (fs.js:141:20)

And the error happened because instance.stdout is undefined. but why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant