Quickly remove old node_modules folders with npkill

Quickly remove old node_modules folders with npkill

Bryan Dugan1 min read

Here's a quick tip that I have discovered to save space on your local drive. There's a utility called npkill that helps to remove old node_modules folders to help save space easily.

To use npkill, start by opening up a terminal window and navigating to your web projects directory. It's not recommended to search your entire computer as it may take a long time, and it will also show the required resources for other applications on your computer.

Navigate to your web projects folder

 cd www/

Run npkill by typing

npx npkill

./npkill-1.png

From there, select a directory with the up/down arrows and delete a directory with the spacebar. I ended up saving a total of around 4GB of space the first time I ran the utility. Run this command periodically to remove unneeded node_modules folders on your projects.

Note: Any links leading you to products or services are most likely affiliate links that I will receive compensation from. I only promote products or services that I own/use myself and truly feel will deliver value to you. By purchasing products or service through these links, you will help support me to keep creating awesome ad-free content.