Developer•4 min read•Jul 30, 2026

Reclaim 40+ GB of Dead node_modules & Package Manager Caches on Mac

Marcus Vance
DevOps Architect

Quick answer

List every node_modules folder with its size using `find ~ -name node_modules -type d -prune -exec du -sh {} +`, then delete the ones in projects you are not working on — `npm install` restores them. Clear package-manager caches with `npm cache clean --force`, `pnpm store prune` and `yarn cache clean`.

1. The node_modules Black Hole

Every JavaScript, TypeScript, React, and Next.js project downloads hundreds of megabytes of nested dependencies. Having 30+ cloned repositories across your drive frequently consumes 30–80 GB of SSD space.

2. Finding Stale node_modules Directories

# Find all node_modules in your projects directory
find ~/Projects -name "node_modules" -type d -prune

# Clean npm global cache
npm cache clean --force

# Clean pnpm global store
pnpm store prune

Skip the Terminal: see it all in one scan

CleanYourMac Space maps every cache, build folder and model file by size, then cleans only what you pick — everything goes to the Trash first, so it's always recoverable.