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:
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
If you are facing issue with angular/cli then use the following commands: npm uninstall -g angular-cli to uninstall the angular/cli. npm cache clean to clean your npm cache from app data folder under your username. use npm cache verify to verify your cache whether it is corrupted or not.
We will use the following command to uninstall Angular CLI like this: npm uninstall -g @angular/cli.
I have also faced the same issue in recent past for me I have do the following commands one by one in terminal.
sudo npm uninstall -g angular-cli sudo npm cache clean
After this run
ng -v
If still get angular-cli version 1.0.0-beta.2x.x then run the following command
which ng
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.
sudo rm -rf /lib/node_modules/@angular/cli/bin/ng sudo rm -rf /usr/bin/ng
Next you need to install @angular/cli using
sudo npm install -g @angular/cli
Close all the terminal and run ng -v and you are on. May be it will help someone. Thanks :)
If you are facing issue with angular/cli then use the following commands: npm uninstall -g angular-cli
to uninstall the angular/cli. npm cache clean
to clean your npm cache from app data folder under your username.
use npm cache verify
to verify your cache whether it is corrupted or not.
use npm cache verify --force
to clean your entire cache from your system.
Note:
You can also delete by the following the paths C:\Users\"Your_syste_User_name"\AppData\Roaming\npm
and C:\Users\"Your_syste_User_name"\AppData\Roaming\npm-cache
Then use the following command to install latest angular/cli version globally in your system. npm install -g @angular/cli@latest
To get more information visit github angular-cli update.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With