Remove node_modules Recursively
npm registry is getting around 350 million downloads daily, at the current time of writing this post. That's almost 2.2 billion downloads per week and you can take the calculation further.
Nonetheless, after all your efforts are paid of and everything is deployed and is over cloud, either Github or some deployment service you or your client prefers, I think it will be generous to remove
node_modules that take useful space on our local machines (especially, Mac users with limited GigaBytes of SSD).
There’s a simple command that you can run in your terminal either in a folder or from the root.
This will delete
node_modules folder in every local repository/directory that's on your system so take precaution or exclude those projects that you are currently working on.
However, don’t panic. Everything can be back to normal just by going into the project’s directory and running package installing command:
I have used this command earlier today it saved me up to 9 GB of space from local system over several projects that I am currently not working or are already on Github.
I even replaced
bower_components to do the same thing:
The latest Tweets from Aman Mittal 🖖 (@amanhimself). #BookBlogger @ https://t.co/UQvyNf1OTC | Developer | #Nodejs |…twitter.com