How to resolve In-memory PM2 is out-of-date
Asked Answered
C

1

15

Amazon AWS Ubuntu server

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial

Problem: PM2 is out-of-date

$ pm2 list

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

Tried

pm2 update

... works until I reboot

Tried

npm remove pm2 -g
which pm2 
npm install pm2@latest -g
which pm2
sudo reboot

Any pointers?

Clance answered 15/8, 2018 at 14:2 Comment(0)
T
18

I had the same problem and could solve it with re-creating the startup script. Try the following steps:

  • delete current process
    pm2 delete nameOfProcess
    
  • unload current startup script
    pm2 unstartup systemd
    
  • update pm2
    pm2 update
    
  • enable startup script
    pm2 startup //copy paste the output
    
  • start process again
    pm2 start nameOfProcess
    
  • save current config
    pm2 save
    
Typecase answered 10/6, 2020 at 16:38 Comment(3)
All of these + rm -rf /home/ec2-user/.pm2 where ec2-user is you current userRaina
@Raina rm -rf /home/ec2-user/.pm2 was not necessary in my case for Ubuntu 20.04.2 LTS and [email protected]Discant
I found that the steps pm2 delete nameOfProcess and pm2 start nameOfProcess can be omitted, and it solves the problem anyway.Broads

© 2022 - 2024 — McMap. All rights reserved.