ZL
About Articles Contact
Published on Dec 29, 2024
Filed under:
#javascript

Killing and Restarting pm2

I encountered a strange error with pm2 that has the following properties:

  1. pm2 list displays nothing even though processes should be running
  2. After restarting a couple of projects, pm2 list still displays nothing
  3. Running pm2 list hogs the server and creates a spike (see picture below).
pm2 list spike

Killing pm2, node, and reinstalling the latest version of pm2 fixed the problem for me.

Terminal window
pkill -9 PM2
pkill -9 node
npm 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.

Previous A little rant about breaking changes Next Setting up a Corne Keyboard v4

Join My Newsletter

I share what I’m learning on this newsletter: code, building businesses, and living well.

Sometimes I write about technical deep-dives, product updates, musings on how to live, and sometimes my struggles and how I’m breaking through.

Regardless of the type of content, I do my best to send you an update every week.

If you’re into making things and growing as a person, you’ll probably feel at home here.

“

Zell is the rare sort of developer who both knows his stuff and can explain even the most technical jargon in approachable — and even fun — ways!

I’ve taken his courses and always look forward to his writing because I know I’ll walk away with something that makes me a better front-ender.

Geoff Graham
Geoff Graham — Chief Editor @ CSS Tricks
The Footer

General

Home About Contact Testimonials Tools I Use

Projects

Magical Dev School Splendid Labz

Socials

Youtube Instagram Tiktok Github Bluesky X

Follow Along

Email RSS
© 2013 - 2025 Zell Liew / All rights reserved / Terms