简体   繁体   中英

I uninstalled angular-cli using npm uninstall -g angular-cli. However, it is still installed when I check ng --version

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?

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

maybe you need to clean cache, try this:

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM