pm2 + socket.io 出现错误
发布于 9 年前 作者 lik0914 5189 次浏览 最后一次编辑是 8 年前 来自 问答

pm2 + socket.io 出现 Error: ENOENT, no such file or directory at Object.exports.resolve (path.js:309:52) at Function.Module._resolveLookupPaths (module.js:260:17) at Function.Module._resolveFilename (module.js:328:31) at Function.Module._load (module.js:280:25) at Function._load (/usr/local/node_js/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21) at Module.require (module.js:364:17) at require (module.js:380:17) at Socket.<anonymous> (/data/www/emao.com/trunk/app/dealer/system/chat/app.js:236:9) at Socket.emit (events.js:95:17) at Socket.onevent (/usr/local/node_js/node_modules/socket.io/lib/socket.js:327:8)

pm2 看进程状态变成 errored 了, 而且, pm2 restart 的时候,提示,进程已经存在了
5 回复

demo有吗?pm2 + socket 太笼统,

nodejs版本是?

@i5ting Node v0.12.x pm2 0.14.x

@haozxuan 线上运行,总共四个进程, 其他三个正常,就一个出现errored

@lik0914 If you delete the working directory from which the node process was started (after node was started), calling process.cwd() throws an error. 是这样吗?正常情况下好像是不会出现这个问题的。

回到顶部