ScrubsDownload

Guides › Mac folder guide · updated

How much space do npm, Homebrew and other package caches use on a Mac?

~/.npm/_cacache
~/Library/pnpm/store
~/.yarn/berry/cache
~/.bun/install/cache
~/Library/Caches/Homebrew
~/Library/Caches/org.swift.swiftpm
~/Library/Caches/CocoaPods
~/Library/Caches/go-build
~/go/pkg/mod
~/.cache/uv
~/.m2/repository
~/.cargo/registry

By Parsa Nasirimehr

Each package manager keeps every package it ever downloaded, so they install faster next time. None of them shrinks much on its own. They're safe to clear with each tool's own clean command; anything a project needs downloads again on its next install.

How big it gets

On the Mac we measured, a working developer's Mac on macOS 27: about 14 GB across 12 caches: uv 2.9 GB, npm 2.5 GB, SwiftPM 2.1 GB, Yarn 1.5 GB, Bun 1.1 GB, Go modules 1.0 GB, Go build cache 0.9 GB, Maven 0.7 GB, pnpm 0.6 GB, Homebrew 0.5 GB, CocoaPods 0.1 GB and Cargo 0.1 GB.

What it is

What writes themEvery install, add or build. Each tool keeps its own cache, so a Mac with several languages has several.
Why they growEvery version of every package you've installed stays, including ones no project uses any more. Homebrew is the exception: it removes downloads older than 120 days on its own.
pnpm is differentProjects hard-link files from pnpm's store, so the store and your node_modules folders share the same space. Deleting the store frees less than its size suggests until you prune it.
Comes back?Yes, as you install again, but only with what your current projects use.

How to clear it

  1. npm: npm cache clean --force
  2. pnpm: pnpm store prune (removes only packages no project uses)
  3. Yarn: yarn cache clean --all; Bun: bun pm cache rm
  4. Homebrew: brew cleanup --prune=all
  5. SwiftPM: swift package purge-cache; CocoaPods: pod cache clean --all
  6. Go: go clean -cache and go clean -modcache
  7. uv: uv cache clean; pip: pip cache purge
  8. Maven and Cargo have no clean command: delete ~/.m2/repository or ~/.cargo/registry/cache, and they download again.

What you lose: Time and bandwidth: the next install of each project downloads its packages again. Offline installs stop working until it has.

With Scrubs: Scrubs's Quick Wins lists these caches by tool with their sizes, so you can clear the big ones and leave the rest. Download Scrubs; scanning is free.

Related folders

Sizes measured with du on 2 November 2026. Paths and commands apply to macOS 15 and later. See also how to free up disk space on a Mac.

About the author: Parsa Nasirimehr is a mobile app developer who builds Scrubs, a disk map for the Mac. Spotted something wrong? Write to support@getscrubs.app.