Ionic CLI not uninstalling

15,650

Solution 1

What is your node and npm versions ?

Please update latest node js (https://nodejs.org/en/download/current/) then check that

 node -v  
 npm -v

Node version must be v8.5.0 (includes npm 5.3.0) and then

 sudo npm uninstall -g ionic 
 sudo npm cache clean --force
 sudo npm install ionic

check the ionic version

ionic -v 

version will be ^3.10.1. If everything is ok you can use new project command as given below

ionic start --list 

you can see what kind of project types here as an example

ionic start blank

Solution 2

npm uninstall -g ionic

npm uninstall -g @ionic/cli

finally i was able to uninstall with this...

Solution 3

I had the same issue for resolving this

  1. Run npm uninstall -g ionic
  2. Go to the location "/usr/local/bin/"
  3. Delete Ionic File
  4. Close terminal
  5. Open new terminal and run "npm uninstall -g ionic"
  6. Now run "ionic -v"

Solution 4

This probably happens due to multiple installations of ionic in your machine, more so this happens on windows. Run: "where ionic" in your command prompt

if it does not work try :

"which ionic" !! (probably linux)

This will give you the location of your installed ionic, in windows its mostly ..Local\AppData\Roaming.. somewhere.

Go to that location delete ionic and ionic.cmd file there.

Run: ionic -v now, make sure it gives you an error.

Be Happy if you see error.

run: npm install ionic@latest -g now

Run: ionic -v, make sure you see your latest ionic version there.

Be more happy now.

Solution 5

Uninstall cordova and ionic.

npm uninstall -g cordova
npm uninstall -g ionic

Then check to make sure you have the right version:

ionic -v
Share:
15,650

Related videos on Youtube

chrispytoes
Author by

chrispytoes

Updated on June 04, 2022

Comments

  • chrispytoes
    chrispytoes almost 2 years

    This is related to my previous question here which was never resolved. I am trying to fix the problem by doing a fresh reinstall of Ionic.

    I first tried uninstalling Ionic with sudo npm uninstall -g ionic, and it completes with no errors, but doing ionic -v still outputs 2.1.1, so obviously it didn't really get uninstalled. After that I tried sudo npm install -g ionic@latest, and my problem still persists.

    What is even weirder is what happened when I tried to create a new project from scratch to test it. I did ionic start test --v2 on my Ubuntu machine, and doing ionic serve still does the same thing that I stated in my previous question.

    • Mahmood Sanjrani
      Mahmood Sanjrani over 6 years
      did you try to reinstall NodeJS ?
    • chrispytoes
      chrispytoes over 6 years
      @MahmoodSanjrani Just tried uninstalling and reinstalling nodejs and npm. Then I uninstalled Ionic and still, even before reinstalling Ionic again ionic -v still outputs 2.1.1.
  • chrispytoes
    chrispytoes over 6 years
    Okay so I was on nodejs 7. I updated to 8.5 and uninstalled ionic again and I can still run ionic -v and get 2.1.1. I tried the cache clean and installing ionic again anyway and still getting 2.1.1.
  • chrispytoes
    chrispytoes over 6 years
    Nope, still does the same thing outside the project directory.
  • Dr. X
    Dr. X over 6 years
    it does not make sense.
  • chrispytoes
    chrispytoes over 6 years
    I know, I've been fighting with this problem for weeks. It makes no sense at all. It sounds more like an Ubuntu system issue. I'll probably put this on Ask Ubuntu.
  • Priyank Gujarati
    Priyank Gujarati over 6 years
    have you tried to uninstall the ionic without sudo? It may be possible that two ionic cli have been installed : one for local user and another for sudo user.