ahmadawais / corona-cli

🦠 Track the Coronavirus disease (COVID-19) in the command line. Worldwide for all countries, for one country, and the US States. Fast response time (< 100ms). To chat: https://twitter.com/MrAhmadAwais/
https://NodeCLI.com
MIT License
1.85k stars 191 forks source link

SyntaxError: Unexpected token #67

Closed delgreco closed 4 years ago

delgreco commented 4 years ago

Red Hat EL7, node 6.17.1

/usr/lib/node_modules/corona-cli/index.js:36 (async () => { ^

SyntaxError: Unexpected token ( at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:160:9)

ahmadawais commented 4 years ago

Before filing a bug it's important that you check if you are using the latest version of the CLI or not. I'm pretty sure you're on an older deprecated version.

UPDATE corona-cli by running:

npm i -g corona-cli

Peace! ✌️

delgreco commented 4 years ago

I did try this, thank you... however encountered the same error after. Looks like corona-cli 3.8.6

~: sudo npm i -g corona-cli /usr/bin/corona -> /usr/lib/node_modules/corona-cli/index.js /usr/bin/corona-cli -> /usr/lib/node_modules/corona-cli/index.js /usr/lib └── corona-cli@3.8.6

/usr/lib/node_modules/corona-cli/index.js:36 (async () => { ^

SyntaxError: Unexpected token ( at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:160:9)

ahmadawais commented 4 years ago

You are using an old version of Node. I don't support Node below 12 since those not maintained. Update you Node version so it can support features like async/await.