devowlio / node-lame

LAME is an open-source encoder that encodes and decodes audio to the MP3 file format. For all MP3 needs a Node.js wrapper of the full LAME command line.
Other
82 stars 9 forks source link

Issue on production environment VS dev environement #18

Closed davidnjuko closed 4 years ago

davidnjuko commented 4 years ago

Hi,

I'm facing an issue with node lame but only on the deployed version of my application. Everything works well locally but when trying to execute the same piece of code on live environment here is the error message I get.

Error: ENOENT: no such file or directory, unlink '/usr/src/xxx-api/node_modules/node-lame/lib/build/../../temp/encoded/8tNiXo1oPQEnk9z0tbJ84ytTupp1OMZa' 
at Object.unlinkSync (fs.js:952:3) 
at Lame.removeTempFilesOnError (/usr/src/xxx-api/node_modules/node-lame/lib/build/Lame.js:337:18)     
at Promise.then.catch (/usr/src/xxx-api/node_modules/node-lame/lib/build/Lame.js:139:22) 
at process._tickCallback (internal/process/next_tick.js:68:7)

And here is the piece of code

 encoder = new Lame({
                    "output": "buffer",
                    "bitrate": 192
                    }).setBuffer(request.payload.file._data);

...

 encoder.encode()
                    .then(async () => {
                        const buffer = encoder.getBuffer();
}).catch((error) => {
                        console.log(error);
                    });
davidnjuko commented 4 years ago

seems to be a duplicate of #1

Sorry for that.

And thanks again