简体   繁体   中英

Node-Red Pm2 Setup

I am trying to start my node-red on a raspberry pi 2 using pm2. I am using the startup command:

pm2 start /usr/bin/node-red-pi --node-args="--max-old-space-size=128" -- -v

At first it seems to work:

NodeRed启动pm2

But unfortunatly then it errors:

NodeRed错误pm2

Thats the log:

SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function._load (/usr/local/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)
at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:28:21)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)

Please make sure you installed the latest PM2 version (>2.x):

$ npm install pm2@latest -g
$ pm2 update

Then start node-red again, it should works as expected:

pm2 start node-red --node-args="--max-old-space-size=128" -- -v 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM