I am a web developer. I checkout many OSS projects and build them. Node modules are notorious in creating too many small files. I am running out of free iNodes because of that. I want an easy way (in linux) to lookup for all node_modules
and delete unwanted ones. I am using the below command to list all node_modules
directory and then delete them manually.
find ~/projects -name node_modules -prune
Is there a first-class utility that provides better way to manage node_modules
?
If you set the NODE_PATH environment variable to this path, the modules can be found by node. Non-global libraries are installed the node_modules sub folder in the folder you are currently in.
If you set the NODE_PATH environment variable to this path, the modules can be found by node. Non-global libraries are installed the node_modules sub folder in the folder you are currently in. You can run npm list to see the installed non-global libraries for your current location.
Non-global libraries are installed the node_modules sub folder in the folder you are currently in. You can run npm list to see the installed non-global libraries for your current location. Show activity on this post.
A single node_modules folder can take up anywhere from 200+ megabytes of space (sometimes 1GB+ !). Now take a look at your github/ folder, or wherever else you're storing the majority of your projects, and you can start to see where some of your free hard-drive space has gone!
Just use this: find . -name "node_modules" -prune -exec rm -rf '{}' +
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With