Easiest way to delete old node_modules folders with npkill

Jason Garey
2 min readOct 1, 2021

If you’re like me and you like to create lots of React projects, they’re probably taking up a significant portion of your hard drive space. The main culprit in this situation is the node_modules folder. npkill solves this problem by giving you a nice little interface inside of the terminal to choose which node_modules folders to delete.

Example on Windows

context menu after shift + right click
Shift + Right Click to open PowerShell windows here

Open a terminal in your projects directory.

Type in the command npx npkill. This allows you to just press the SPACE key for each node_modules folder that you want to delete.

I was able to free up a little over 5gbs of space by deleting my node_modules folders. I realize this all can be done in one go using the find command. That said, I still prefer using npkill and choosing which specific folders to delete. For more information on npkill go to its GitHub page here.

--

--