pip / npm / npx / pnpm caches: reclaim 10–50 GB the boring way

The commands

npm cache clean --force            # ~/.npm/_cacache
rm -rf ~/.npm/_npx                 # npx one-off installs (this one is huge!)
pnpm store prune                   # pnpm store
pip cache purge                    # ~/.cache/pip
yarn cache clean                   # yarn v1: ~/.cache/yarn

~/.npm/_npx deserves special mention: every npx some-tool leaves a full node_modules tree. AI-agent users hit tens of GB here.

Verify

du -sh ~/.npm ~/.cache/pnpm ~/.cache/pip

FAQ

Is npm cache clean safe?
Yes — it's a content-addressed cache, rebuilt on demand.
npx tools break?
They re-download on next run. Nothing permanent is lost.

One-click alternatives

Don't want to touch the terminal? These do it safely (paid):

CleanMyMac (macOS) — free scan DaisyDisk (macOS) CCleaner (Win/Mac)

Sponsored links. We only list tools we'd run ourselves.