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.
53 Answers
I had the same issue.
To resolve this:
- Run
npm uninstall -g ionic - Go to the location
/usr/local/bin/ - Delete the Ionic file
- Close the terminal and open a new one, or start a new shell
- Run
npm uninstall -g ionic - Now run
ionic -v
Trychown -R "$(whoami)": "$(npm root -g)"
You may need to use sudo for this operation.
And then uninstall using sudo npm uninstall -g <package>.Reference
In my case, I tried all of the above including global uninstall and force clearing the cache. What worked for me was:
> which create-react-app
> /usr/local/bin/create-react-app
> rm -rf /usr/local/bin/create-react-app
> npm cache clean --force
> npm cache verifyAfter that I was able to run npx create-react-app myapp and everything worked.
(Note that I am using OSX and not Ubuntu but wanted to post here anyway since I think the above would apply here as well.)