DiskBroomWhat it cleans › How to safely clear npm, pnpm, and Yarn caches

Cleaning guide

Node caches: gigabytes of packages you already installed.

~/.npm · ~/Library/Caches/pnpm · ~/Library/Caches/Yarn

What it is

Every package your projects install is kept as a compressed copy so future installs skip the network. npm calls it _cacache, pnpm keeps a content-addressed store, Yarn keeps tarballs — the idea is identical.

How big it gets

Commonly 1–5 GB per package manager; on this machine's most recent scan, the npm cache alone was 2.86 GB. Heavy monorepo work pushes higher.

What happens if you delete it

Completely safe: caches re-fill from the registry as you install. Your node_modules folders and lockfiles are untouched — the only cost is slower first installs while the cache warms back up.

How to remove it manually — free, no app needed

  1. npm: npm cache clean --force (npm insists on --force; it verifies integrity otherwise).
  2. pnpm: pnpm store prune removes unreferenced packages — the safe default.
  3. Yarn: yarn cache clean
  4. Verify what came back: du -sh ~/.npm ~/Library/Caches/pnpm ~/Library/Caches/Yarn 2>/dev/null

Risk rating

Safe. Pure re-downloadable cache, verified by checksums on the way back in. Nothing unique ever lives here.

Prefer not to do this by hand every time? DiskBroom scans this location (and every other one on its published list), shows the size, rates the risk with the same shape you see above, and asks before anything moves — everything goes to the Trash, never past it. Scanning is free forever.

Download DiskBroom free

More cleaning guides

← Everything DiskBroom can clean · FAQ