Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot uninstall angular-cli

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

like image 907
Sandro Palmieri Avatar asked Mar 28 '17 13:03

Sandro Palmieri


People also ask

Can not uninstall angular CLI?

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.

How do I uninstall angular CLI?

We will use the following command to uninstall Angular CLI like this: npm uninstall -g @angular/cli.


2 Answers

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 :)

like image 95
sib10 Avatar answered Sep 27 '22 18:09

sib10


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.

like image 31
Prabhat Maurya Avatar answered Sep 27 '22 19:09

Prabhat Maurya