Killing and Restarting pm2
I encountered a strange error with pm2 that has the following properties:
pm2 listdisplays nothing even though processes should be running- After restarting a couple of projects,
pm2 liststill displays nothing - Running
pm2 listhogs the server and creates a spike (see picture below).
Killing pm2, node, and reinstalling the latest version of pm2 fixed the problem for me.
pkill -9 PM2pkill -9 nodenpm i -g pm2@latest`After you have done these things, restart each of your applications and pm2 should run fine again.
Edit: Marc Ram emailed me and made a good point. In his words:
If you blindly reinstall pm2latest, you run the risk of having to deal with unexpected breaking changes, perhaps you should reinstall the specific version of pm2 you are currently using, or limit it to the latest minor update until you can verify that the latest pm2 version on a staging/test server does not break anything. Or at least read the release notes to check for breaking changes first.