Clear All Node Modules Folders Recursively

Remove all node_modules folders within a directory with one simple command.

Clearing node_modules

The node_modules folder takes up a lot of space, especially if you have several projects in a folder. This simple bash command will help you clear all node_module folders within the directory you are located in.

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