看日志啊
@i5ting 看哪里的日志,docker的还是pm2的?
pm2 的日志:
2016-07-01 05:20:42: [PM2][WORKER] Process 0 restarted because it uses 0 memory and has ONLINE status 2016-07-01 05:20:42: Stopping app:api id:0 2016-07-01 05:20:42: App name:api id:0 disconnected 2016-07-01 05:20:42: App name:api id:0 exited with code SIGTERM 2016-07-01 05:20:42: Process with pid 28 killed 2016-07-01 05:20:42: Starting execution sequence in -cluster mode- for app name:api id:0 2016-07-01 05:20:42: Error: spawn /usr/local/bin/node ENOENT at exports._errnoException (util.js:874:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32) at onErrorNT (internal/child_process.js:344:16) at doNTCallback2 (node.js:439:9) at process._tickDomainCallback (node.js:394:17) 2016-07-01 05:20:42: App name:api id:0 disconnected
Error: spawn /usr/local/bin/node ENOENT
@haozxuan,这个该怎么改呢?升级nodejs版本?
@kilobitcy 这个关键字,百度一大把。。。跟pm2 无关,这类问题可以归为无权限操作;
建议 直接启动 看看有什么错误
能正常运行在说
楼上的兄弟,谢谢你们支招。我补充些问题的信息:
- node bin/www,能正常启动,正常运行
- pm2 start bin/www,能正常启动,正常运行 ( fork模式 )
- pm2 start bin/www -i 0,能正常启动,不能正常运行 ( cluster模式 )