I uninstalled angular-cli using npm uninstall -g a

2019-05-30 13:04发布

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?

4条回答
叛逆
2楼-- · 2019-05-30 13:24

maybe you need to clean cache, try this:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
查看更多
3楼-- · 2019-05-30 13:35

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楼-- · 2019-05-30 13:45

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.

查看更多
倾城 Initia
5楼-- · 2019-05-30 13:48

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

查看更多
登录 后发表回答