I've tried several times to uninstall my angular-cli in order to update it but even if I follow the instructions provided on github:
- npm uninstall -g @angular/cli
- npm cache clean
- npm install -g @angular/cli@latest
When I check using the command ng --version I still get the old version :
angular-cli: 1.0.0-beta.26
node: 7.7.1
os: darwin x64
How can i fix this issue? Thanks
I had the same problem. This doesn't work:
instead use:
I could not get the angular-cli to go away. I FINALLY figured out a way to find it on my windows machine. If you have Cygwin installed or you are running linux or mac you can run
which ng
and it will give you the directory the command is running from. In my case it was running from/c/Users/myuser/AppData/Roaming/npm/ng
You are using the beta version of angular CLI you can do this way.
Then type,
Then go to the AppData folder which is hidden in your users and go to roaming folder which is inside AppData then go to npm folder and delete angular files in there and also go to npm-cache folder and delete angular components in there.After that restart your PC and type
This worked for me ✌️
Check if you have the hidden folder ".npm" in your Home directory and delete the old angular-cli folder.
I have also faced the same issue in recent past for me I have do the following commands one by one in terminal.
After this run
If still get angular-cli version 1.0.0-beta.2x.x then run the following command
It will show the ng path. Go to the path and if it is linked with any file remove the same the link and actual ng file. In my case the link is in /usr/bin/ng and actual path of ng file is /lib/node_modules/@angular/cli/bin/ng.
Next you need to install @angular/cli using
Close all the terminal and run ng -v and you are on. May be it will help someone. Thanks :)
I found a solution, first, delete the ng file with
then install nvm (you need to restart your terminal to use nvm).
then install and use node 6 via nvm
finally install angular cli
this worked for me, I wanted to update to v1.0 stable from 1.0.28 beta, but couldn't uninstall the beta version (same situation that you desrcibed). Hope this works