Ubuntu – npm not really uninstalling global package

nodejsnpm

This is a follow up question from something I posted on Stack Overflow here. Nobody was able to figure it out, and I'm not sure if this is an Ubuntu system issue or not so forgive me if I'm in the wrong place but I wasn't sure where else to go with this.

I am trying to update my version of Ionic CLI but no matter what I try it seems to be stuck on version 2.1.1, it should be 3.10.1.

I tried uninstalling ionic with sudo npm uninstall -g ionic and it succeeds without a hitch. But for some reason I can still use the ionic -v command which still outputs 2.1.1. This command shouldn't work at all after uninstalling it.

I tried updating it anyway using sudo npm install -g ionic@latest and that also works without errors. But ionic -v still outputs 2.1.1, when it should be 3.10.1.

I also tried reinstalling nodejs and npm entirely and I still get the same thing.

I am on nodejs 8.5, npm 5.4.1, and Ubuntu 16.04.

Best Answer

I had the same issue.

To resolve this:

  1. Run npm uninstall -g ionic
  2. Go to the location /usr/local/bin/
  3. Delete the Ionic file
  4. Close the terminal and open a new one, or start a new shell
  5. Run npm uninstall -g ionic
  6. Now run ionic -v
Related Question