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.

Skip the manual steps. Tidy Mac finds this and every other hidden space hog on your Mac in under a minute.

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.

Our verdict: 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/Yarn, ~/.yarn/berry/cache, ~/Library/Caches/pnpm, ~/Library/pnpm/store, ~/.bun/install/cache, ~/Library/Caches/deno, ~/Library/Caches/pip, ~/Library/Caches/pypoetry, ~/.cache/uv, ~/.cache/pip, ~/miniconda3/pkgs, ~/anaconda3/pkgs, ~/opt/miniconda3/pkgs, ~/opt/anaconda3/pkgs, ~/.conda/pkgs, ~/.gradle/caches, ~/.m2/repository, ~/.cargo/registry, ~/go/pkg/mod, ~/Library/Caches/go-build, ~/Library/Caches/org.swift.swiftpm, ~/Library/Caches/CocoaPods, ~/Library/Caches/org.carthage.CarthageKit, ~/.pub-cache, ~/.cache/node-gyp, ~/Library/Caches/ms-playwright, ~/.cache/puppeteer

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.

With Tidy Mac: Developer package caches

Tidy Mac’s Clean screen lists the npm, pip, uv and Cargo caches as Safe to clear (preselected), and the pnpm store, Gradle, Maven and Go module caches as Worth a look, so you decide. Caches in ~/Library/Caches, such as Homebrew’s and Yarn’s, appear with App caches. Whatever Tidy Mac removes goes to the Trash first, and History lets you undo it.

See your own developer package caches in seconds

See every part of your storage explained, and clear junk to the Trash with Undo. $9.99 $29 once, 2 Macs.

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