Delete All node_modules Folders Recursively

10/17/20191 Min Read — In Node.js, JavaScript, DevTools

If you'd like to clean your system by deleting all node_modules folders (and saving tons of disk space), you can type:

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

It also works well with fd:

fd node_modules -x rm -rf '{}' +

Further Reading