Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 Error: ENOENT: no such file or directory, uv_cwd #1

Open
sophister opened this issue Jan 4, 2017 · 2 comments
Open

pm2 Error: ENOENT: no such file or directory, uv_cwd #1

sophister opened this issue Jan 4, 2017 · 2 comments

Comments

@sophister
Copy link
Owner

今天测试环境的pm2又抽了,重启服务一直挂掉,一直报这个错误:

var path = (i >= 0) ? arguments[i] : process.cwd();
                                                 ^

Error: ENOENT: no such file or directory, uv_cwd
    at Error (native)
    at Object.posix.resolve (path.js:424:50)
    at Function.Module._resolveLookupPaths (module.js:250:17)
    at Function.Module._resolveFilename (module.js:317:31)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/opt/app/nodev5/lib/node_modules/pm2/lib/ProcessContainer.js:12:15)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
2017-01-04 13:58:11: App name:NODE-MOBILE-v1 id:20 disconnected
2017-01-04 13:58:11: App [NODE-MOBILE-v1] with id [20] and pid [15091], exited with code [1] via signal [SIGINT]

Google之后,发现是pm2的守护进程出问题了,具体见这篇issue,解决方法搬过来记录下:

DId you check PM2's its own Working Directory (pwd)?
PM2 daemon's working directory should not be in removable directory.

So, How to check PM2's working directory?
It's easy. Try this methods.

1. Type ps ax | grep PM2 on your console and hit Enter.
You'll find your PM2 daemon process row, first column is pid which is Number. remember/note it.
2. Type ls -l /proc/PM2_PID/cwd
Check working directory is removable (will be removed) directory.
3. If PM2 running in removable directory. Kill PM2 daemon (pm2 kill) and start pm2 daemon on another directory (e.g. cd ~ && pm2)
@longxianlin
Copy link

longxianlin commented Sep 18, 2017

proc not a directory
mac os

@sophister
Copy link
Owner Author

@longxianlin 上面是在 CentOS 上的问题哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants