[2020-03-31] Delete All node_modules on your Machine

Just in case it might useful for anyone else. Free up space on your hard drive by recursively deleting all /node_modules/ within a given directory. The commands are Mac/Linux compatible.

# Get a total size of 'node_modules' folders
find . -name "node_modules" -type d -prune -print | xargs du -chs

# This will REMOVE ALL found 'node_modules' folders
find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' +

Warning: Use the commands above at your own risk 😛

Edit on GithubPublished on 2020-03-31

Copyright © 2019...2020 Nick S. Plekhanov