Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete nodejs devDependencies

Is there a way to delete devDependencies in nodejs without deleting everything. I have no npm on the destination server so I do the following:

$ npm install $ grunt build $ rm -rf node_modules $ npm install --production 

Does anyone know if there exists an npm module that can purge installed modules. TIA!

like image 679
chriskelly Avatar asked Aug 29 '14 15:08

chriskelly


People also ask

Can I remove devDependencies?

The npm prune command, without any arguments will clean up any packages that are installed and not listed in your dependency lists. Optionally, you can pass in --production which will remove any dependencies that are listed in your devDependencies .

How do I remove unused devDependencies from package json?

You can use npm-prune to remove extraneous packages. Extraneous packages are packages that are not listed on the parent package's dependencies list. If the --production flag is specified or the NODE_ENV environment variable is set to production, this command will remove the packages specified in your devDependencies.

How do I uninstall dependency node?

To remove a package from your node_modules directory, on the command line, use the uninstall command. Include the scope if the package is scoped. This uninstalls a package, completely removing everything npm installed on its behalf.


Video Answer


1 Answers

You can use npm prune --production

like image 111
ControlAltDel Avatar answered Oct 13 '22 23:10

ControlAltDel