Answer the question
In order to leave comments, you need to log in
PM2 NODEJS error how to fix?
Started learning NODEJS, installed nodejs package in Ubuntu. I launched a test file hello.js in the terminal, launching an http server with the output Hello Word (node /usr/share/nginx/node/hello.js) - everything works.
Now, as I understand it, in order to start the server without blocking the terminal, you need PM2. Installed.
However, any pm2 commands simply or pm2 start /usr/share/nginx/node/hello.js
gives an
error:
/usr/local/lib/node_modules/pm2/node_modules/debug/src/node.js:132
let val = process.env[key];
^^^
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: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/pm2/node_modules/debug/src/index.js:9:19)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
Answer the question
In order to leave comments, you need to log in
You have an old node installed, the eighth one is in the default repository.
Here's how to install a new one
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question