dwaring87 / rtm-cli

Remember the Milk Command Line Interface
MIT License
66 stars 14 forks source link

Syntax error in log function #3

Closed mumeiyamibito closed 6 years ago

mumeiyamibito commented 6 years ago

I installed rtm-cli from npm but the app did not work by syntax error.

$ sudo npm install -g rtm-cli
$ rtm
/usr/local/lib/node_modules/rtm-cli/src/utils/log.js:12
function log(text="", newline=true) {
                 ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    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)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/rtm-cli/src/cli.js:9:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

How can I use rtm-cli?

OS: LinuxMint 18.3 npm: 3.5.2

dwaring87 commented 6 years ago

Which version of node are you using? node -v

Since rtm-cli uses some features from ECMAScript 6 (including assigning default function argument values, which is the error you're encountering), it requires a more recent version of node. From what I've tested it should work with node version >= 7.5.0.

Thanks for pointing this out and I'll add the node version to the README.

mumeiyamibito commented 6 years ago

The version of my node which was obtained from default repository of LinuxMint 18.3 was 4.2.6. When node was upgraded to 9.4.0, rtm-cli works well. Thanks for replying and helping me.

dwaring87 commented 6 years ago

I'm glad it's working!