我以这种方式安装了webpack:
npm install -g webpack
现在要卸载它:
npm uninstall -g webpack
再次检查,它没有被卸载:
webpack -v
3.1.0
为什么?
而且,我用这种方式找不到webpack
:
npm list -g | grep webpack
这也不起作用:
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.
尝试
(您可能需要sudo),然后再次npm install -g