如何使用 npm 卸载全局包? [英] How to uninstall global package with npm?

查看:153
本文介绍了如何使用 npm 卸载全局包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这样安装webpack的:

I have installed webpack in this way:

npm install -g webpack

现在想卸载它:

npm uninstall -g webpack

再次检查,它没有被卸载:

Check it again, it didn't been uninstalled:

webpack -v
3.1.0

为什么?

而且,我用这种方式找不到webpack:

And, I use this way can't find webpack:

npm list -g | grep webpack

<小时>

这也不起作用:


This also didn't work:

npm uninstall -g webpack --save

<小时>

在包含 package.json 的目录下运行后:

npm uninstall webpack
npm WARN babel-loader@6.4.1 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.
npm WARN uglifyjs-webpack-plugin@0.3.1 requires a peer of uglify-js@^2.8.0 but none was installed.
npm WARN uglifyjs-webpack-plugin@0.3.1 requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.

推荐答案

尝试运行以下两个:

npm uninstall -g webpack
npm uninstall webpack

我认为您可能会在仅删除全局版本后检查/查看本地版本.

I think you might be checking/lloking at the local version after deleting only the global one.

这篇关于如何使用 npm 卸载全局包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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