I uninstalled angular-cli using npm uninstall -g a

2019-05-30 13:23发布

问题:

What is going on here?

On my laptop, I ran npm uninstall -g angular-cli, and it is gone.

However, on my desktop, I can still run ng --version after removing angular-cli globally.

What is going on and how can I fix this?

回答1:

There is always a global installation and a local one in your project.

So run npm uninstall angular-cli in your project path and its gone finally! :)



回答2:

maybe you need to clean cache, try this:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest


回答3:

I had the same problem with updating angular-cli, ng -v was always returning the same version after few installs/uninstalls of angular-cli or new @angular/cli. The problem was that in nodejs installation folder there were ng and ng.exe files. I removed them, installed @angular/cli and had fresh version of it.



回答4:

Your npm version might have changed, relocating the binaries folder. Thus, npm cannot uninstall something which it does not know it existed in the first place. In unix, ls -l $(whereis ng) might help you out eliminate old folders.