Nodejs, pm2PM2启动服务提示:Error: ENOENT: no such file or directory, uv_cwd 解决办法已关闭评论
3月232020
PM2中重启服务时,出现下面提示:
PM2: path.js:422
PM2: var path = (i >= 0) ? arguments[i] : process.cwd();
PM2: ^
PM2:
PM2: Error: ENOENT: no such file or directory, uv_cwd
PM2: at Error (native)
PM2: at Object.posix.resolve (path.js:422:50)
PM2: at Function.Module._resolveLookupPaths (module.js:248:17)
PM2: at Function.Module._resolveFilename (module.js:326:31)
PM2: at Function.Module._load (module.js:286:25)
PM2: at Module.require (module.js:365:17)
PM2: at require (module.js:384:17)
PM2: at Object.<anonymous> (/usr/local/bin/node_modules/pm2/lib/ProcessContainer.js:12:15)
PM2: at Module._compile (module.js:434:26)
PM2: at Object.Module._extensions..js (module.js:452:10)
Nodejs, pm2[PM2] Spawning PM2 daemon with pm2_home=/home/ec2-user/.pm2问题排查已关闭评论
11月192019
新aws机器部署了老nodejs项目,使用pm2 start config.js启动,提示:
[PM2] Spawning PM2 daemon with pm2_home=/home/ec2-user/.pm2
没有错误提示,pm2 log / pm2 status都看不到信息, nodejs项目也没启动。
其实可以通过查看~/.pm2/pm2.log 文件获取真正错误信息:
SyntaxError: Unexpected identifier
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.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/nodejs/lib/node_modules/pm2/lib/Watcher.js:6:16)
/home/ec2-user/.pm2/pm2.log (END)
/usr/local/lib/nodejs/lib/node_modules/pm2/node_modules/chokidar/index.js:151
async remove(item) {
^^^^^^