·4 min read

node_modules Eating Disk Space on Mac — Find and Clean Them

Every JavaScript project leaves behind a node_modules folder, and years of old projects can quietly consume tens of gigabytes across your Mac.

If you've done any JavaScript or Node.js development, you know the joke: node_modules is the heaviest object in the universe. Every project you've ever cloned or created has its own node_modules folder, often 200-500 MB, sometimes over a gigabyte for projects with heavy build tooling. Multiply that across dozens of old side projects, tutorials you followed once, and cloned repos you never deleted, and you can easily have 20-50 GB locked up in dependency folders you'll never run again.

Why node_modules folders pile up unnoticed

  • They're hidden in plain sight — buried inside project folders, not flagged as "cache" or "temp" anywhere
  • Every project has its own copy — npm and yarn don't share dependencies across projects by default the way pnpm does
  • They regenerate instantly — running npm install rebuilds the folder in seconds, so there's rarely a reason to keep an old one around
  • Old projects are easy to forget — a tutorial repo from two years ago still has its full node_modules sitting there

Finding every node_modules folder on your drive

Developers often use a Terminal one-liner like find ~ -name "node_modules" -type d -prune -exec du -sh {} \; to list them, but that produces a flat, hard-to-scan text output with no sense of which ones are actually worth deleting first.

Canopy gives you a visual alternative: scan your Projects or home folder and the treemap will show every node_modules directory as a proportionally sized block, so the biggest ones — often in projects with heavy frameworks or bundlers — stand out immediately.

Canopy treemap highlighting large node_modules folders across Mac development projects

Zoom into your dev folder

Double-click into your projects directory to see each project's footprint, including its node_modules subfolder, sized relative to the rest.

Safe to delete, almost always

Unless you plan to run a project again without internet access, node_modules can be deleted freely — npm install or yarn rebuilds it from package.json in moments.

Clean up directly from the map

Delete old node_modules folders right from the treemap, project by project, and rescan to see the gigabytes come back.

Get Canopy on the Mac App Store

Next Article

Canopy

See exactly where your disk space goes with an interactive treemap.

Get Canopy on the Mac App Store