[JS] This command will help you to free some disk space
Guga Cavalieri
Posted on October 14, 2019
My work laptop has an small SSD Disk (128 GB) so I often receive some system notifications alerting me that my /home
is running low on disk space.
After some digging I found out that many projects under my /dev
folder had a node_modules
folder inside eating up a bunch of space.
So I needed a magical command to remove these folders recursively and here is what I found in my first Google search result:
Clear all node_modules Directories | Mac and Linux
- Open your terminal.
- Browse to your master project directory or the top level of where you have a bunch of projects stored.
- Run the command:
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
- (Optional) Create an alias (node-modules-clean)
This helped to free up 5GB on my SSD. Hope it helps you too :)
Source: rtmccormick.com
💖 💪 🙅 🚩
Guga Cavalieri
Posted on October 14, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Simplifying Excel Table Parsing in Node.js with @libs-jd/xlsx-parse-table
November 9, 2024
javascript Introducing sast-scan: A Lightweight SAST npm Package for JavaScript Security
October 19, 2024