DEV Community

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

Collapse
 
markpieszak profile image
Mark Pieszak

Won’t this delete everything, and not just the node_modules themselves ? I’ll have to give it a try ! I saw someone else post this as well:

robocopy EMPTY_FOLDER node_modules /mir

Collapse
 
gnuchu profile image
John Griffiths

It’ll delete everything under the destination path. Syntax is:

Robocopy <source> <destination> /MIR

With a redirect to null to remove output.

I’m not a node dev but devops who has to regularly remove these things from build slaves. Obviously there’s a cost on next build re-downloading.