Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
677 views
in Technique[技术] by (71.8m points)

node.js - How to uninstall global package with npm?

I have installed webpack in this way:

npm install -g webpack

Now want to uninstall it:

npm uninstall -g webpack

Check it again, it didn't been uninstalled:

webpack -v
3.1.0

Why?


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

npm list -g | grep webpack

This also didn't work:

npm uninstall -g webpack --save

After run this under a directory which included package.json:

npm uninstall webpack
npm WARN [email protected] requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.
npm WARN [email protected] requires a peer of uglify-js@^2.8.0 but none was installed.
npm WARN [email protected] requires a peer of webpack@^1.9 || ^2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try running both of the below commands:

npm uninstall -g webpack
npm uninstall webpack

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...