Developer package caches on Mac: Homebrew, npm, pip, pnpm, Yarn and Bun

Downloaded copies of code packages kept by Homebrew, npm, pip and Yarn.

Short answer

Package manager caches are safe to clear because packages are downloaded again when needed. Use each tool’s own command: brew cleanup, npm cache clean --force, pip cache purge, yarn cache clean, pnpm store prune. The next install of a package may just take a little longer.

The five questions

What is this?

Downloaded copies of code packages kept by Homebrew, npm, pip and Yarn.

Why is it big?

Every version you ever installed is kept, just in case.

Is it safe to remove?

Yes. They're downloaded again when needed.

What happens after?

The next install of a package may take a little longer.

Will it come back?

Yes, as you install things.

TidyMac label: Safe. Your Mac or your apps recreate this automatically. Removing it won’t lose anything you made.

How big it gets: 2–30 GB on developer Macs. pnpm stores and npm’s _cacache are often the largest.

Where it lives: ~/Library/Caches/Homebrew, ~/.npm/_cacache, ~/Library/Caches/pip, ~/Library/Caches/Yarn, ~/Library/Caches/pnpm, ~/Library/pnpm/store, ~/Library/Caches/CocoaPods, ~/.bun/install/cache, ~/Library/Caches/go-build

The commands, in one place

brew cleanup -s
npm cache clean --force
pip cache purge
yarn cache clean
pnpm store prune

Do it yourself

Open Terminal and type brew cleanup, then npm cache clean --force, then pip cache purge.

brew cleanup && npm cache clean --force
~/Library/Caches/Homebrew, ~/.npm/_cacache, ~/Library/Caches/pip, ~/Library/Caches/Yarn.

See your own developer package caches in seconds

Scan free, see every part of your storage explained, and clean only what’s safe. Everything goes to the Trash first.

Frequently asked questions

Is it safe to delete developer package caches on a Mac?

Yes. They're downloaded again when needed.

Why are my developer package caches so big?

Every version you ever installed is kept, just in case.

What happens after I remove developer package caches?

The next install of a package may take a little longer.

Will developer package caches come back?

Yes, as you install things.

How do I clean developer package caches manually?

Open Terminal and type brew cleanup, then npm cache clean --force, then pip cache purge.

Keep reading