Remove Global Package Npm Code Example


Example 1: How to uninstall npm modules in node js?


The command is simply npm uninstall <name>
// Here are different options:
// - removes the module from node_modules but
// does NOT update package.json
npm uninstall <name>

// - removes it from dependencies in package.json aswell
npm uninstall <name> --save

// - removes it from devDependencies in package.json aswell
npm uninstall <name> --save-dev

// - also removes it globally
npm uninstall -g <name> --save

// If you're removing a global package, however, any applications
// referencing it will crash.

// A local install will be in the node_modules/ directory of your
// application. This won't affect the application if a module remains
// there with no references to it.

// The Node.js documents https://npmjs.org/doc/ have all the commands
// that you need to know with npm.

Example 2: how to uninstall global package npm


npm uninstall -g <package-name>
# example
npm uninstall -g webpack

Example 3: how to globally uninstall npm package


npm uninstall -g <package_name>

Example 4: how to unistall dependencies


npm un <package_name>

Example 5: how to globally uninstall npm package


npm uninstall -g <@scope/package_name>

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools