简体   繁体   English

如何全局卸载 npm 包提交?

[英]How to globally uninstall an npm package commitizen?

I'm trying to uninstall a globally installed npm package named commitizen .我正在尝试卸载名为commitizen的全局安装的 npm 包

When I run this npm uninstall -g commitizen , this returns no results:当我运行这个npm uninstall -g commitizen ,这不会返回任何结果:

在 0.035 秒内更新

I restarted the machine.我重新启动了机器。

Now, to check if the package indeed got uninstalled or not I'm running commitizen expecting an error however to my surprise the command is still available:现在,为了检查软件包是否确实被卸载了,我正在运行commitizen期待错误,但令我惊讶的是,该命令仍然可用:

承诺

The result of npm list -g --depth 0 or npm list -g commitizen : npm list -g --depth 0 or npm list -g commitizen

npm list -g --depth 0 或 npm list -g commitizen

The result of npm list -g commitizen : npm list -g commitizen的结果:

npm list -g commitizen

The result of cd /usr/local/lin/node_modules cd /usr/local/lin/node_modules

cd /usr/local/lin/node_modules

So the question is what is the right approach of globally deleting the npm package?所以问题是全局删除 npm 包的正确方法是什么?

One way to check would be running npm list -g --depth 0 or npm list -g commitizen检查的一种方法是运行npm list -g --depth 0 or npm list -g commitizen

If you want to check the package locally, head to /usr/local/lin/node_modules如果要在本地检查包,请前往/usr/local/lin/node_modules

Uninstalling global packages might answer this question: 卸载全局包可能会回答这个问题:

"So the question is what is the right approach of globally deleting the npm package?" “所以问题是全局删除 npm 包的正确方法是什么?”


In addition, I had a similar problem on windows 10. I solve it just by upgrading npm to the latest version .另外,我在windows 10上也遇到了类似的问题。我只是通过将npm升级到最新版本来解决它。

Make sure it works with npm ls -g --depth=0 or npm list -g commitizen .确保它适用于npm ls -g --depth=0npm list -g commitizen

If that still doesn't work try to running npm uninstall -g commitizen one more time.如果这仍然不起作用,请尝试再次运行npm uninstall -g commitizen

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

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