r15ch13/audible-converter

node.js dependecies & Buffer.alloc is not a function

Closed this issue · 2 comments

I was missing nodejs-legacy and a bunch of other node packages:
lodash, fluent-ffmpeg, commander, sanitize-filename, winston, bluebird

Error example:

$ ./audible-converter "audiobook.aax" -a <my_activation_key>
module.js:328
    throw err;
    ^

Error: Cannot find module 'winston'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/toby/MyStuff/Audiobooks/software/audible-converter/main.js:13:17)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)

I had to run:
apt install nodejs-legacy
npm install <node_packages>

After that I got the error:

error: Buffer.alloc is not a function

Now I don't know how to fix this, please help me.

EDIT: I also just tried to symlink nodejs to node but the same Buffer.alloc error is occuring

My system is:
Linux Mint 18.3
4.13.0-26-generic

OK so my problem was a outdated version of node.
I had to upgrade node as found here:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Everything is working now. Thanks for the awesome tool.