My node-app is running in PM2. When I pull the latest version of my app off github and rebuild it, the site during the building process defaults to a much older version (probably the first version when I initially launched the daemon). How can I make it show the latest version before the fetch, while I rebuild to the really latest version?
Restart on file change To totally disable the watch feature, do: pm2 stop app --watch or toggle the watch option on application restart via pm2 restart app --watch .
js App in Development Mode with PM2. At this point, your server will auto-restart each time you create, modify or delete a source file in your project. It also works when you add or remove a dependency with npm or yarn .
yes, you need to install it globally.
To serve the latest code in the directory, run:
$ pm2 reload APP_NAME
You can find out APP_NAME by
$ pm2 list
When you fetch the latest code and want to run it, restart the server with
$ pm2 reload APP_NAME
To Start a server for the first time with a specific name
$ pm2 start path/to/index.js --name "api"
Note: On linux you might have to run pm2 with sudo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With