vtop icon indicating copy to clipboard operation
vtop copied to clipboard

SyntaxError: Use of const in strict mode

Open ronilaukkarinen opened this issue 6 years ago • 3 comments

I have updated node and npm, but every time running, getting the error below. System is Ubuntu Server 14.04.

rolle@ghost:~$ vtop

/usr/local/lib/node_modules/vtop/app.js:3
const App = ((() => {
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/vtop/bin/vtop.js:6:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

ronilaukkarinen avatar Sep 11 '19 12:09 ronilaukkarinen

What version of nodejs? You may need to run it via node directly with the --harmony flag.

Eeems avatar Sep 11 '19 15:09 Eeems

I have v10.16.3. But I've tried different versions from 7 and up, everything outputs this same error. I have no idea how to run directly with --harmony, haven't used it before.

This is also strange because vtop works on other similar 14.04 server I have... humm.

ronilaukkarinen avatar Sep 12 '19 06:09 ronilaukkarinen

Same issue here.

Ended up having to call node with the path to the app.js. With nvm and my version of Node, this ended up being:

node ~/.nvm/versions/node/v8.9.4/lib/node_modules/vtop/app.js

sunny avatar Jan 04 '20 15:01 sunny