无法删除全局软件包 [英] Unable to remove global package
问题描述
尝试删除全局软件包,但似乎并未删除它.
Trying to remove a global package and it doesn't seem to be removing it.
$ eslint -v
v1.10.3
$ npm uninstall eslint -g
$ sudo npm uninstall eslint -g
$ eslint -v
v1.10.3
$ sudo eslint -v
v1.10.3
$ which eslint
/usr/local/bin/eslint
您可以看到eslint仍为1.10.3版本.为什么不删除呢?
You can see that eslint is still at version 1.10.3. Why is this not deleting?
推荐答案
可能发生的情况是npm试图将其从一个地方删除,但您仍将其安装在其他地方.
Probably what happens is that npm is trying to remove it from one place but you have it still installed somewhere else.
例如,这是一个问题. npm
程序在shebang行中使用#!/usr/bin/env node
,而不是安装了node
二进制文件的确切补丁(对于Node的二进制安装很常见),尤其是当您在许多地方安装了多个版本的Node时.
This is a problem when e.g. the npm
program uses #!/usr/bin/env node
in the shebang line instead of the exact patch to the node
binary for which it was installed (common for binary installations of Node) especially when you have many versions of Node installed in many places.
看看结果是什么
which node
which npm
cat `which npm` | head -1
cat `which eslint` | head -1
ls -alp `which npm`
ls -alp `which eslint`
cat $PATH
并尝试缩小问题范围.
这篇关于无法删除全局软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!