Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall npm modules with dev dependencies in node.js?

Tags:

node.js

npm

How can I uninstall npm modules with devDependencies in Node.js?

like image 996
Hasara Avatar asked May 26 '19 16:05

Hasara


People also ask

How do I remove a module from node modules?

First, you must delete the dependency from your node_modules/ folder, and second, remove its listing from your package. json. This ensures the package is fully removed. Instead of performing this task manually, we can use the npm uninstall command.

How do I remove multiple npm dependencies?

Uninstall all global npm packages If you want to uninstall all global packages, then you need to name the packages one by one in the npm uninstall -g command. Run the npm list -g --depth=0 command to list the packages installed globally on your computer. That should uninstall all global packages for you.


1 Answers

Use command:

1)npm uninstall <name of the module>

Also you can use:

1) npm uninstall <name of the module>: to remove the module from node_modules, but not package.json

2) npm uninstall <name of the module> --save: to also remove it from dependencies in package.json

3) npm uninstall <name of the module> --save-dev: to also remove it from devDependencies in package.json

4) npm -g uninstall <name of the module> --save: to remove it globally

like image 113
Deepak Tatyaji Ahire Avatar answered Oct 19 '22 12:10

Deepak Tatyaji Ahire