DEV Community

Cover image for Kill node_modules 😑
Kunal Agrawal
Kunal Agrawal

Posted on

Kill node_modules 😑

Why node_modules?

node_modules, each of our incomplete million dollar project contains this folder, which is taking some fair amount of space in your PC. so how to remove it?

One way is that you can sink your ship 🚒 into your codebase hell and delete node_modules folder one by one.

or you can run

npx npkill
Enter fullscreen mode Exit fullscreen mode

This gives you a nice CLI to delete node_modules from your million dollar projects.

Just hit space and that will delete node_modules from that folder.

But that seems like u're using a node module to delete a node_modules.

If you love πŸ’– to use terminal, and more concerning about Developer Experience (DX). you can use this command instead

rm -r **/node_modules
Enter fullscreen mode Exit fullscreen mode

this will remove all sub node_modules folder inside your project.


Now we have modern javascript runtime like deno, bun. That's support out of the box TypeScript Support, can manage packages using URL based configuration. So stop using node_modules πŸ˜‚

That's it for this article, hope you get something useful. Share your thoughts on this article in socials.

Let's Connect -
Tweet Thanks
https://linktr.ee/kunal.dev

Top comments (0)