I want my application to automatically restart on Windows reboot. I am using the pm2-windows-startup
package provided by the npm. But, I am having an issue. When I restart the remote server and enter the pm2 list
command in the cmd, it shows my application as online
. However, when I hit the application's URL in my browser, I get a This site can’t be reached
error.
I have followed the instructions provided by their official documentation.
The only way my application runs after a restart is by using the below commands:
pm2 kill
pm2 resurrect
The server has Windows Server 2012 R2 operating system.
I don't know why is this happening despite following all the instructions provided by the repository. Any help would be appreciated. Thanks!
CodePudding user response:
You can try this other package: https://www.npmjs.com/package/pm2-windows-service
It install PM2 as a service where pm2-window-startup just wrote a startup string in registry.
If you want more informations, you have this post: Windows: Auto start PM2 and node apps