Cannot uninstall Ionic 1.7.14

#1

I am trying to switch to ionic 2. Installing on top of my previous installation of ionic 1 appears to succeed but ionic 1 remains as shown by ionic info.Here were the steps.

  • Successfully Installed ionic2@beta using sudo npm install -g ionic@beta

  • ionic -v shows version 1.7.14

  • Uninstalled using npm uninstall -g ionic

  • Successfully uninstalled ionic 2

  • ionic -v shows version 1.7.14

  • Tried ‘npm uninstall -g ionic’ again

  • Received prompt again (no affect)

  • ionic -v shows version 1.7.14

1 Like
#2

I have the exact same problem. Is there a solution for this yet?

#3

With some investigation I found out what was going wrong. At some point earlier I had installed ionic version 1 which got loaded by npm in /usr/local/lib as part of the sub-directory node_modules. Later on when I installed version 2 globally with sudo it installed it in my home directory ~/.npm-global/lib/node_modules/ionic/bin. The installed program was a node script called ionic. The bash alias was still pointing to the version 1 code. I don’t know why npm changed the directory. To fix the problem, I did the following:

  • Deleted the folder /usr/local/bin/node_modules/ionic

  • Removed the symbolic link to the alias named ionic

  • Re-installed the ionic@beta globally using sudo. This created the node script ionic in ~/.npm-global/lib/node_modules/ionic/bin. Not sure why npm chose to install it in my home directory.

  • Tested it using the full path to the node script ionic

  • Create a symbolic link named ionic so I can access the command from anywhere in my home directory.

  • Reloaded cordova 4.3 (because it was suggested in another forum. Not sure it is relevant)

I should have found this earlier but I am getting rusty in my command line skills. It turns out that ionic-cli works for both v1 (if you have some v1 code) and v2.

1 Like
#4

ah thanx, that worked!
Still think it’s an annoying bug though.

#5

also affects Ionic version 1.7.16 .

#6

And if you use windows. You should find ionic in ‘C:\Users\JAC\AppData\Roaming\npm\node_modules’ and delete it.

2 Likes
#7

Hey, thank you. I found that removing the symlinks and uninstalling ionic and updating npm to the latest version solved the issue for me. I was able to install the latest version of ionic.