AllToMP3 / alltomp3-cli

Download a song in one-command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

nguyend14 opened this issue · comments

/usr/local/lib/node_modules/alltomp3-cli/node_modules/alltomp3/index.js:866
let filename = .startCase(.toLower(_.deburr(artist))) + ' - ';
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/alltomp3-cli/index.js:5:18)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)

I changed all the "let" to "var" and that is a workaround.

It's because you need a more recent version of NodeJS, for example I use NodeJS v7.2.0.

on Mac
rm -rf /usr/local/lib/node_modules

To install node version manager:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

To list versions:
nvm ls-remote

To install v7.2.1:
nvm install 7.2.1

cd path/to/alltomp3-cli-master
npm install -g

Thanks!