1

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.

  • What does which ionic says? – Hi-Angel Sep 13 '17 at 18:21
  • @Hi-Angel it gives me /usr/local/bin/ionic – chrispytoes Sep 13 '17 at 18:26
  • And what does dpkg -S /usr/local/bin/ionic says? – Hi-Angel Sep 13 '17 at 18:28
  • @Hi-Angel dpkg-query: no path found matching pattern /usr/local/bin/ionic – chrispytoes Sep 13 '17 at 18:32
  • This is indeed weird. I've read a bit through man of npm, and did a quick (local though) installation and uninstallation of ionic, and it works fine. You most probably have encountered some bug of ionic. If your ultimate goal is to upgrade it to the newer version, I can only recommend to dive into technical details of where and how does npm stores its list of packages, to try to see e.g. whether it being removed from the list or not, what it does upon upgrading, et cetera… Running under strace might also give some insight. – Hi-Angel Sep 13 '17 at 18:43
0

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

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.