This usually means that pm2
is running under PID that differs from the one in your .pm2/pm2.pid
To exit from this situation try one of these:
pm2 kill
or
ps aux | grep pm2
and then kill -9 PID
found in PM2 vX.X.X: God Daemon
if none of the above help:
pkill node && \
pm2 delete all && \
pm2 flush && \
kill -9 $(head -n 1 /home/$USER/.pm2/pm2.pid) && \
rm -rf /home/$USER/.pm2
After that run pm2 ls
or whatever pm2
command you want. That should daemonize pm2
again with the correct PID in .pm2/pm2.pid
EDIT
Another possible reason could be any error during the pm2
init, so if the above doesn't work for you check .pm2/pm2.log
for any errors and fix them