19

How to uninstall npm modules with dev dependenciesin node.js?

Deepak Tatyaji Ahire
  • 4,241
  • 2
  • 9
  • 27
Hasara
  • 191
  • 1
  • 1
  • 3
  • 2
    Possible 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
  • 2
    Unless 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 Answers1

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