DEV Community

Discussion on: Anyone can show me how to safely delete node_modules to clear up harddisk space?

Collapse
 
rdhox profile image
rdhox

There is no big problem that I know of to delete the node_modules folder of a project. A simple yarn or npm install will recreate it.

I use this line of code to get rid of my node_modules folders in the root of all my project's folders (before a backup for example):

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

More info here: stackoverflow.com/questions/429505...