Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 
like image 572
cloud_cloud Avatar asked Jul 07 '17 04:07

cloud_cloud


People also ask

How do I uninstall global packages?

Uninstalling global packages To uninstall an unscoped global package, on the command line, use the uninstall command with the -g flag. Include the scope if the package is scoped.

How do I uninstall node globally?

Just like you use the flag “-g” or “-global” before the name of the package to be installed in the packages globally, you use “-g” or “-global” before the name of the package you want to uninstall.

Can I delete npm package?

On the npm "Sign In" page, enter your account details and click Sign In. Navigate to the package page for the package you want to unpublish, replacing <your-package-name> with the name of your package: https://www.npmjs.com/package/<your-package-name> . Click Settings. Under "delete package", click Delete package.


1 Answers

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.

like image 81
Sujith Avatar answered Oct 04 '22 23:10

Sujith