How much space do node_modules and dev caches use?

One read-only command finds every node_modules, .next, target and .venv folder in your home folder and measures the big developer caches. Paste the output to get the totals.

1. Run this in Terminal

It only reads: find lists folders and du measures them. Nothing is changed or sent anywhere. On a big disk it can take a few minutes. macOS may ask whether Terminal can open Desktop or Documents; if you say no, those folders are skipped.

 Terminal
find ~ -path ~/Library -prune -o -path ~/.Trash -prune -o \( -name node_modules -o -name .next -o -name target -o -name .venv \) -type d -prune -print 2>/dev/null | while IFS= read -r d; do du -sk "$d" 2>/dev/null; done; du -sk ~/Library/Developer/Xcode/DerivedData ~/Library/Developer/Xcode/iOS\ DeviceSupport ~/Library/Developer/Xcode/Archives ~/Library/Developer/CoreSimulator ~/Library/Developer/CoreDevice ~/.npm ~/.gradle/caches ~/.android/avd ~/Library/Containers/com.docker.docker ~/.cargo/registry ~/Library/Caches/pip ~/.cache/huggingface ~/.ollama/models ~/Library/Caches/Yarn ~/Library/pnpm/store ~/Library/Caches/Homebrew ~/Library/Caches/CocoaPods ~/Library/Caches/org.swift.swiftpm ~/Library/Developer/Xcode/UserData/Previews ~/Library/Developer/Xcode/watchOS\ DeviceSupport ~/go/pkg/mod ~/.m2/repository ~/Library/Caches/ms-playwright ~/Library/Caches/JetBrains ~/miniconda3/pkgs ~/Library/Android/sdk ~/Library/Developer/XCTestDevices ~/Library/Caches/com.apple.dt.Xcode ~/Library/Developer/CoreSimulator/Caches ~/.pub-cache ~/.bun/install/cache ~/Library/Caches/deno ~/.rustup/toolchains ~/.cargo/git ~/.gradle/wrapper/dists ~/Library/Android/sdk/system-images ~/.npm/_npx ~/.pyenv/versions ~/.cache/uv ~/.nvm/versions/node ~/Library/Application\ Support/Code/Cache ~/.vscode/extensions ~/.ssh 2>/dev/null

2. Paste the output here

What it measures

Nested folders are counted once, so a node_modules inside another node_modules does not inflate the total.

Rebuildable does not mean the project around it is safe. Check git status before deleting anything in a project. Read how to delete node_modules safely.

Questions

Does the command delete anything?

No. It runs find and du, which only read folder sizes.

Why is .venv listed as check first?

A Python virtual environment can only be recreated if the project lists its packages, so look before deleting it.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.

Download for Mac