To remove all node_modules
folders recursively from a directory run:
find . -name "node_modules" -exec rm -rf '{}' +
I have a few top level directories on my machine including
I was able to run this command in the parent directory and reclaim space in all the sub-directories.
You can adapt this to other project types by changing node_modules
to the other platforms' dependency/build folder.
For Rust:
find . -name "target" -exec rm -rf '{}' +
For Elixir:
find . -name "deps" -exec rm -rf '{}' +
Now what to do with all this space? 😄