---
title: "Clear Homebrew, npm, pip, pnpm and Yarn caches on Mac"
description: "Homebrew, npm, pip, pnpm and Yarn keep every package version you ever downloaded. Here are the cache locations on a Mac and the right cleanup command for each."
url: https://tidymac.space/learn/homebrew-npm-pip-caches/
updated: 2026-10-08
---

[Home](/) [Library](/learn/) Developer package caches

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

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

SafeTypical size: 2–30 GB on developer MacsUpdated October 8, 2026By the Tidy Mac team

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.

[Download free](/download/TidyMac.dmg)[Buy · $9.99 $29](/buy/)

## 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.

![](/img/brand/tidy-128.png)

### 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.

[Download](/download/TidyMac.dmg) [Buy Tidy Mac · $9.99 $29](/buy/)

## 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

[What is .npm/\_cacache?npm](/folders/npm-cacache/)[What is Caches/Homebrew?Homebrew](/folders/homebrew-cache/)[Log files on Mac (~/Library/Logs)Library](/learn/mac-log-files/)[Apple Mail “Mail Downloads” folderLibrary](/learn/mail-downloads-folder/)[Messages attachments on MacLibrary](/learn/messages-attachments-mac/)

Share:[X](https://x.com/intent/post?text=Developer%20package%20caches%20on%20Mac%3A%20Homebrew%2C%20npm%2C%20pip%2C%20pnpm%2C%20Yarn%20and%20Bun&url=https%3A%2F%2Ftidymac.space%2Flearn%2Fhomebrew-npm-pip-caches%2F)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Ftidymac.space%2Flearn%2Fhomebrew-npm-pip-caches%2F&title=Developer%20package%20caches%20on%20Mac%3A%20Homebrew%2C%20npm%2C%20pip%2C%20pnpm%2C%20Yarn%20and%20Bun)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Ftidymac.space%2Flearn%2Fhomebrew-npm-pip-caches%2F&t=Developer%20package%20caches%20on%20Mac%3A%20Homebrew%2C%20npm%2C%20pip%2C%20pnpm%2C%20Yarn%20and%20Bun)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Ftidymac.space%2Flearn%2Fhomebrew-npm-pip-caches%2F)

#### On this page

[The five questions](#the-five-questions)[The commands, in one place](#the-commands-in-one-place)[Do it yourself](#do-it-yourself)[With Tidy Mac](#with-tidymac)[FAQ](#faq)

**Tidy Mac**

See this on your own Mac in under a minute. $9.99 $29 once, 2 Macs.

[Download](/download/TidyMac.dmg)
