Pm2: Uninstalling PM2 completely on Ubuntu

Created on 26 Jul 2015  路  9Comments  路  Source: Unitech/pm2

Hi,

I have installed PM2 to test some apps, all good went well, but how do I uninstall PM2 now? I have tried npm remove pm2, but that does not remove pm2 at all. Also, the PM2 God Daemon runs in the backagound. The documentation does not explain how to uninstall PM2 as well. Any help in uninstalling PM2 would be great.

Thanks,

Most helpful comment

pm2 kill
npm remove pm2 -g
#test with :
which pm2

This should do the trick.

All 9 comments

pm2 kill
npm remove pm2 -g
#test with :
which pm2

This should do the trick.

Hi

Thank you for your quick reply. I have tried the commands as you suggested. The following is the output.

nitturi@neutron:~$ pm2 kill
[PM2] Spawning PM2 daemon
[PM2] PM2 Successfully daemonized
[PM2] Stopping PM2...
[PM2][WARN] No process found
[PM2] All processes have been stopped and deleted
[PM2] PM2 stopped
nitturi@neutron:~$ npm remove pm2 -g
npm WARN uninstall not installed in /usr/lib/node_modules: "pm2"
nitturi@neutron:~$ which pm2
/usr/local/bin/pm2
nitturi@neutron:~$

Not sure where I have gone wrong when installing pm2. I also tried with sudo npm remove with the same WARN message.

Thanks

This looks more like a specific configuration / npm error.
I tried with a nvm installation, it worked just fine.
Anyway, removing the bin/ and lib/ PM2 files (wherever they are) as well as ~/.pm2/ directory should do the trick.

Ever since I had a typo in my pm2 list command i used pm2 listr instead
pm2 keeps showing following to any pm2 xxx command

```path.js:1175
cwd = process.cwd();
^

Error: ENOENT: no such file or directory, uv_cwd
at Object.resolve (path.js:1175:25)
at Function.Module._resolveLookupPaths (module.js:431:17)
at Function.Module._resolveFilename (module.js:549:20)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/pm2/bin/pm2:11:17)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
```

Even npm uninstall -g pm2 and pm2 kill

Has anybody solved this issue?
If not I guess I will figure out by my own.
Thanks.

Hi,

I uninstalled pm2 using sudo:

pm2 kill
sudo npm remove pm2 -g

test with :

which pm2

Regards

Kenshiro-28 solutions worked for me. Thanks

For ME the it works Kenshiro-28

Great! :)

Was this page helpful?
0 / 5 - 0 ratings