tj / commander.js

node.js command-line interfaces made easy
MIT License
26.58k stars 1.69k forks source link

Syntax error in index.js in v:2.17.0 #842

Closed kavishshah closed 6 years ago

kavishshah commented 6 years ago

/scratch3/kavish/local_runs/nightly_2018_08_03/hw/node_modules/hw_scripts/node_modules/commander/index.js:663 if (this._args.filter(a => a.required).length === 0) { ^^ SyntaxError: Unexpected token => at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:429:25) at Object.Module._extensions..js (module.js:464:10) at Module.load (module.js:341:32) at Function.Module._load (module.js:296:12) at Module.require (module.js:351:17) at require (module.js:370:17) at Object. (/scratch3/kavish/local_runs/nightly_2018_08_03/hw/node_modules/hw_scripts/qrsim.js:8:11) at Module._compile (module.js:446:26) at Object.Module._extensions..js (module.js:464:10)

Facing this error after version 2.17.0, things were fine in 2.16.0 and before.

abetomo commented 6 years ago

What is the version of Node.js?

kavishshah commented 6 years ago

node v1.2.0

abetomo commented 6 years ago

I fixed it to support that version.

kavishshah commented 6 years ago

Thanks for the fix! What is the recommended node version to use? It seems the one I have is pretty old now.

roman-vanesyan commented 6 years ago

For production purposes Node 8 as it's now on LTS. Previously Node 6 which will be out of LTS at April 2019.