re: How to delete ALL node_modules folders on your machine and free up HD space! VIEW POST


This is a very nice thread. Thanks!

Well for me, I had 3 projects out of like 15+ in my dev folder that I didn't want the node_modules folder to be deleted.

My little workaround was to rename the node_modules of those projects to node_modules2 so it won't be affected by the script, then I turned it back after.


Yeah a lot of times I just wipe everything out, and go back to the recent projects and npm install again real quick. Check out npkill as well, you can interactively delete node_modules folders with it!

code of conduct - report abuse