Unitech / pm2

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

Init system not found issue on windows when try to 'pm2 startup' #5613

Open sbn111 opened 1 year ago

sbn111 commented 1 year ago

I want to configure node js server even after restarting windows it need to run once the system turned on.

so i am trying to run command pm2 startup as per the documentation

Am receiving the following error

[PM2][ERROR] Init system not found C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\lib\API\Startup.js:209 throw new Error('Init system not found'); ^

Error: Init system not found at API.CLI.startup (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\lib\API\Startup.js:209:13) at Command. (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\lib\binaries\CLI.js:707:9) at Command.listener (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\node_modules\commander\index.js:315:8) at Command.emit (events.js:400:28) at Command.parseArgs (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\node_modules\commander\index.js:651:12) at Command.parse (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\node_modules\commander\index.js:474:21) at Timeout._onTimeout (C:\Users\sarav\AppData\Roaming\npm\node_modules\pm2\lib\binaries\CLI.js:206:15) at listOnTimeout (internal/timers.js:557:17) at processTimers (internal/timers.js:500:7)

DeanB2015 commented 1 year ago

pm2 startup does not work for Windows machines. Please use https://github.com/jessety/pm2-installer

https://pm2.keymetrics.io/docs/usage/startup/#:~:text=To%20create%20a%20startup%20script%3A%201.%20run%20pm2,list%20of%20process%2C%20just%20run%20pm2%20save%20again.