Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntamvl/54d81683624e7d8924b377ca3a59ced4 to your computer and use it in GitHub Desktop.
Save ntamvl/54d81683624e7d8924b377ca3a59ced4 to your computer and use it in GitHub Desktop.
Remove all node_module folders recursively

Remove all node_module folders recursively

find . -name "node_modules" -exec rm -rf '{}' +

That will delete the folder and files even if there is a space in the name.

That saved me about 10GB over several hundred node projects which I had not touched in a while. If I need the node modules back, I can simply run npm install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment