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
install, add or build. Each tool keeps its own cache, so a Mac with several languages has several.node_modules folders share the same space. Deleting the store frees less than its size suggests until you prune it.How to clear it
- npm:
npm cache clean --force - pnpm:
pnpm store prune(removes only packages no project uses) - Yarn:
yarn cache clean --all; Bun:bun pm cache rm - Homebrew:
brew cleanup --prune=all - SwiftPM:
swift package purge-cache; CocoaPods:pod cache clean --all - Go:
go clean -cacheandgo clean -modcache - uv:
uv cache clean; pip:pip cache purge - Maven and Cargo have no clean command: delete
~/.m2/repositoryor~/.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.