安装nvm后无法卸载全局npm软件包 [英] Can't uninstall global npm packages after installing nvm

查看:503
本文介绍了安装nvm后无法卸载全局npm软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了几个与此问题相关的线程,但似乎没有一个专门针对我的情况,并且我无法使用发现的建议来解决.

I've found several threads related to this issue but none seem to deal with my case specifically and I've been unable to solve using the suggestions I've found.

当我运行npm uninstall -g "some package"

它只会返回:up to date in .043s -全局包仍然存在.

例如,我正在尝试uninstall babel-cli,在running npm uninstall -g babel-cli之后,我仍然可以使用cli.

For example I'm trying to uninstall babel-cli and after running npm uninstall -g babel-cli I'm still able to use the cli.

这是在我卸载nodenpm并使用nvm重新安装后开始的.我想知道在卸载node时是否错过了某些东西,这是导致问题的原因.我检查了我的点文件,发现在.nvm之外还有一个.npm.那是正常的吗?预先感谢您的任何建议.

This started after I uninstalled node and npm and reinstalled using nvm. I'm wondering if I missed something while uninstalling node and it's causing the issue. I checked my dot files and noticed I still have a .npm outside of .nvm. Is that normal? Thanks in advance for any suggestions.

推荐答案

(此处为nvm维护者)

(nvm maintainer here)

您可以在npm ls -g --depth=0上找到可以npm uninstall -g进行操作的列表.如果您没有看到要卸载的文件,但仍然可以访问它,那么如果它是npm安装的,则它可能是与您的节点的系统版本一起安装的.

The list of things that you can npm uninstall -g is available at npm ls -g --depth=0. If you don't see the thing you want to uninstall there, but you can still access it, then if it was npm-installed, it was probably installed with your system version of node.

您可以使用nvm use system && npm ls -g --depth=0快速验证这一点.如果您在此处看到该软件包,则在使用系统版本时,可以npm uninstall -g它.

You can quickly verify this with nvm use system && npm ls -g --depth=0. If you see the package there, then while using the system version, you can npm uninstall -g it.

这篇关于安装nvm后无法卸载全局npm软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆