Pm2: always say >>>> In-memory PM2 is out-of-date, do: >>>> $ pm2 update

Created on 21 Oct 2016  ·  23Comments  ·  Source: Unitech/pm2

If reporting a bug, please use the following template.

Expected behaviour

...

Actual behaviour

I delete all of the pm2 file and npm install pm2 -g
...

Steps to reproduce

pm2 list
Be sure to have the latest version by doing npm install pm2@latest -g before doing this procedure.
According to the prompt I npm install pm2@latest -g
but it cant work at all;
...

Software versions used

OS      windows service 2008 r2   :
node.js    :
PM2        :

PM2 Log output

image

Use the command: tail --lines 50 ~/.pm2/pm2.log

...

cf CONTRIBUTING.md for more informations

Windows

Most helpful comment

every time i update pm2, the moment i restart the terminal it tells me to update again shows me this:
what's the solution?

In-memory PM2 is out-of-date, do:

$ pm2 update
In memory PM2 version: 2.1.6
Local PM2 version: 2.4.0

All 23 comments

just run pm2 update

@soyuka
image

Then I kill the node.exe process , it seem run ok, but i start the app , I will wait so long time ?why
image

PM2 on Windows isn't recommended for production environments, specially in that old windows version.

@vmarchaud
so my production environments is windows service 2012
Is it batter than 2008 R2?

I know a company using windows 2012 and 2008 R2 without issues with pm2 ;). (they just migrated to 2012 though)

开始的时候我们用windows 以后 会用Linux
At begining we will use windows service later we will use Linux

thanks @soyuka @vmarchaud

All my tests was under windows 7 so it should be working under windows 2012.

Any progress on that issue @Messilimeng, looks like your bin path is messy

every time i update pm2, the moment i restart the terminal it tells me to update again shows me this:
what's the solution?

In-memory PM2 is out-of-date, do:

$ pm2 update
In memory PM2 version: 2.1.6
Local PM2 version: 2.4.0

Same problem

Run pm2 update

Already done... without success.
pm2 status give me the same answer :

In-memory PM2 is out-of-date, do:
$ pm2 update
In memory PM2 version: 2.3.0
Local PM2 version: 2.4.6

$ pm2 kill -all
$ npm remove pm2 -g
$ npm install pm2 -g
$ pm2 update
$ pm2 --update-env

$ pm2 status ...

Still In memory PM2 version: 2.3.0

Kill all the daemons : ps aux | grep PM2

Just faced the same problem, killing all daemons did not help. But computer reboot helped.
(Debian 8 x64), Node.js 6.10.3.

I used pm2 unstartup to prevent pm2 to restart itself then pm2 update seemed to work

Tried all the above. Still now luck at updating. The script still keeps restarting it self in the background, and I keeps the in memory process going. Restarted, removed/reinstalled pm2 and no dice. Like trying to destroy the undead, the pm2 processes keep respawning. O_O

When running the command from 'pm2 unstartup' i get the following error:

main@Moonlite:~$ pm2 unstartup
[PM2] Init System found: systemd
[PM2] You have to run this command as root. Execute the following command:
sudo env PATH=$PATH:/home/main/.nvm/versions/node/v8.1.0/bin /home/main/.nvm/versions/node/v8.1.0/lib/node_modules/pm2/bin/pm2 unstartup systemd -u main --hp /home/main
main@Moonlite:~$ sudo env PATH=$PATH:/home/main/.nvm/versions/node/v8.1.0/bin /home/main/.nvm/versions/node/v8.1.0/lib/node_modules/pm2/bin/pm2 unstartup systemd -u main --hp /home/main
[PM2] Init System found: systemd
Failed to stop pm2-main.service: Unit pm2-main.service not loaded.

Failed to stop pm2-main.service: Unit pm2-main.service not loaded.

undefinedReturn code : 5

What is up here?

pm2 updatePM2

$ pm2 kill -all
$ npm remove pm2 -g
$ npm install pm2 -g
$ pm2 update
$ pm2 --update-env

$ pm2 status ...

Still In memory PM2 version: 2.3.0

This helped me!
pm2 kill -all && npm remove pm2 -g && npm install pm2 -g && pm2 update && pm2 --update-env

Ok so my issue was that it "APPEARED" to be caused by server but it was apparently on the client. Server was updated and showing. Also had to use npx since i have it as a local dependency and i dont generally use the global since i execute things in scripts.

So running npx pm2 update is probably a good idea for those having issues - this will update your pm2 in node_modules - global is bad mmmmkkkayyyyy :-)

I've had issues as described steming from conflicting installation from ubuntu package manager (apt) having installed pm2 globally as a package (which took priority over anything being installed via npm).

Discovered this by checking which pm2 and whereis pm2 and discovering it was not the binary that npm installed.

I'm just doing that, inspired by reponse on stackoverflow.
https://stackoverflow.com/questions/51860234/how-to-resolve-in-memory-pm2-is-out-of-date

pm2 unstartup systemd
pm2 update
pm2 startup

And it work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jubairsaidi picture jubairsaidi  ·  3Comments

rangercyh picture rangercyh  ·  4Comments

rajendar38 picture rajendar38  ·  3Comments

ghost picture ghost  ·  3Comments

ldarren picture ldarren  ·  3Comments