Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.54k stars 2.62k forks source link

[Question] Properly support nvm for Windows #3739

Open JimiC opened 6 years ago

JimiC commented 6 years ago

What's going wrong?

pm2 does not properly support nvm for Windows

Specifically:

How could we reproduce this issue?

Supporting information

$ 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.

wallet77 commented 6 years ago

Hi @JimiC

We don't really support nvm for windows but if some basic changes can make pm2 compatible, a PR is welcome ;)

JimiC commented 6 years ago

Great, I'll work on it and report back any findings.