How to uninstall npm modules with dev dependenciesin node.js?
Asked
Active
Viewed 1.2k times
19
-
2Possible duplicate of [How to uninstall npm modules in node js?](https://stackoverflow.com/questions/13066532/how-to-uninstall-npm-modules-in-node-js) – TGrif May 26 '19 at 16:31
-
2Unless he is looking for `npm prune --production`. Maybe add this as a fifth point to your list? – gwest7 Feb 10 '21 at 09:05
1 Answers
28
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
Deepak Tatyaji Ahire
- 4,241
- 2
- 9
- 27
-
I was new to this npm thing and these commands helped me to solved my issue. Great Job! – Vishesh Apr 16 '21 at 17:41