简体   繁体   English

我使用npm uninstall -g angular-cli卸载了angular-cli。 但是,当我检查ng --version时,它仍然安装

[英]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. 在我的笔记本电脑上,我运行了npm uninstall -g angular-cli ,它消失了。

However, on my desktop, I can still run ng --version after removing angular-cli globally. 但是,在我的桌面上,在全局删除angular-cli之后,我仍然可以运行ng --version

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! 因此,在您的项目路径中运行npm uninstall angular-cli ,它终于消失了! :) :)

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 . 我在更新angular-cli时遇到了同样的问题, ng -v在几次安装/卸载angular-cli或新的@angular/cli后总是返回相同的版本。 The problem was that in nodejs installation folder there were ng and ng.exe files. 问题是在nodejs安装文件夹中有ngng.exe文件。 I removed them, installed @angular/cli and had fresh version of it. 我删除了它们,安装了@ angular / cli并安装了新版本。

Your npm version might have changed, relocating the binaries folder. 您的npm版本可能已更改,请重新定位Binaries文件夹。 Thus, npm cannot uninstall something which it does not know it existed in the first place. 因此,npm无法卸载它最初不知道的内容。 In unix, ls -l $(whereis ng) might help you out eliminate old folders. 在unix中, ls -l $(whereis ng)可以帮助您消除旧文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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