Ionic CLI not uninstalling
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
- Run npm uninstall -g ionic
- Go to the location "/usr/local/bin/"
- Delete Ionic File
- Close terminal
- Open new terminal and run "npm uninstall -g ionic"
- 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
Related videos on Youtube
chrispytoes
Updated on June 04, 2022Comments
-
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 doingionic -v
still outputs2.1.1
, so obviously it didn't really get uninstalled. After that I triedsudo 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 doingionic serve
still does the same thing that I stated in my previous question.-
Mahmood Sanjrani over 6 yearsdid you try to reinstall NodeJS ?
-
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 over 6 yearsOkay 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 over 6 yearsNope, still does the same thing outside the project directory.
-
Dr. X over 6 yearsit does not make sense.
-
chrispytoes over 6 yearsI 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 over 6 yearshave 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.