Open JimiC opened 6 years ago
pm2 does not properly support nvm for Windows
pm2
nvm
Specifically:
node
--interpreter node@x.x.x
$ pm2 report
[2018-06-26 14:55:39] PM2 log: =============================================================================== [2018-06-26 14:55:39] PM2 log: --- New PM2 Daemon started ---------------------------------------------------- [2018-06-26 14:55:39] PM2 log: Time : Tue Jun 26 2018 14:55:39 GMT+0300 (GTB Daylight Time) [2018-06-26 14:55:39] PM2 log: PM2 version : 2.10.4 [2018-06-26 14:55:39] PM2 log: Node.js version : 6.14.3 [2018-06-26 14:55:39] PM2 log: Current arch : x64 [2018-06-26 14:55:39] PM2 log: PM2 home : C:\Users\%user%\.pm2 [2018-06-26 14:55:39] PM2 log: PM2 PID file : C:\Users\%user%\.pm2\pm2.pid [2018-06-26 14:55:39] PM2 log: RPC socket file : \\.\pipe\rpc.sock [2018-06-26 14:55:39] PM2 log: BUS socket file : \\.\pipe\pub.sock [2018-06-26 14:55:39] PM2 log: Application log path : C:\Users\%user%\.pm2\logs [2018-06-26 14:55:39] PM2 log: Process dump file : C:\Users\%user%\.pm2\dump.pm2 [2018-06-26 14:55:39] PM2 log: Concurrent actions : 2 [2018-06-26 14:55:39] PM2 log: SIGTERM timeout : 1600 [2018-06-26 14:55:39] PM2 log: =============================================================================== [2018-06-26 14:55:40] PM2 log: Starting execution sequence in -fork mode- for app name:app1 id:0 [2018-06-26 14:55:40] PM2 error: Error: spawn C:\Users\%user%\AppData\Roaming\nvm\versions\node\v6.14.3\bin\node ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32) at onErrorNT (internal/child_process.js:376:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9) [2018-06-26 14:55:40] PM2 log: Starting execution sequence in -fork mode- for app name:app2 id:1 [2018-06-26 14:55:40] PM2 error: Error: spawn C:\Users\%user%\AppData\Roaming\nvm\versions\node\v6.14.3\bin\node ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32) at onErrorNT (internal/child_process.js:376:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9) [2018-06-26 14:55:43] PM2 log: App name:app1 id:0 online [2018-06-26 14:55:43] PM2 log: App name:app2 id:1 online
Are you willing to support nvm for Windows? If so I can provide a PR with the necessary changes.
Hi @JimiC
We don't really support nvm for windows but if some basic changes can make pm2 compatible, a PR is welcome ;)
Great, I'll work on it and report back any findings.
What's going wrong?
pm2
does not properly supportnvm
for WindowsSpecifically:
pm2
does not detect the enviromnent variable used bynvm
for Windowspm2
does not detect the correct path to wherenvm
for Windows keeps thenode
versionsHow could we reproduce this issue?
nvm
for Windowsnode
version withnvm
--interpreter node@x.x.x
Supporting information
Are you willing to support
nvm
for Windows? If so I can provide a PR with the necessary changes.