Is it safe to delete ~/.npm and ~/.cache on Mac?
These two hidden folders hold download caches for developer tools, and they get big: 23 GB and 34 GB on our Mac. Almost everything in them downloads again when it's needed.
The short answer
Yes, for caches. Tools download what they need again, so the cost is a slower next install and a network connection. Use each tool's own clean command when it has one. The one thing to think twice about is large AI models in ~/.cache, which can take a long time to download again.
Neither folder holds your projects' node_modules. Clearing them doesn't touch any project.
~/.npm
| Folder | What it is | How to clear |
|---|---|---|
~/ | npm's download cache (20 GB on our Mac) | npm cache clean - |
~/ | Packages npx downloaded to run a command (2.8 GB) | Delete the folder. npx downloads again when needed |
~/ | npm's logs | Safe to delete |
~/.cache
Each tool gets its own folder here, so look before you delete:
du -sh ~/.cache/* | sort -h
| Folder | What it is | How to clear |
|---|---|---|
huggingface | AI models and datasets from Hugging Face (22 GB on our Mac) | Delete the models you don't use. More on AI models |
uv | uv, the Python package manager (7 GB) | uv cache clean, or uv cache prune to keep what's in use |
puppeteer | Browsers downloaded by Puppeteer (551 MB) | Delete. It's downloaded again when a project installs Puppeteer |
Other package caches on a Mac
| Tool | Where | How to clear |
|---|---|---|
| Yarn | ~/ | yarn cache clean |
| pnpm | ~/ | pnpm store prune |
| pip | ~/ | pip cache purge |
| Homebrew | ~/ | brew cleanup |
| Bun | ~/ | bun pm cache rm |
| CocoaPods | ~/ | pod cache clean - |
| Gradle | ~/ | Stop Gradle, then delete the folder |
| Maven | ~/ | Delete. Packages download again |
| Cargo | ~/ | Delete. Crates download again |
How Macaroom handles it
Macaroom lists these under Developer caches, marked Rebuildable: ~/.npm as one item, and each tool in ~/.cache on its own. Hugging Face models appear under AI models, one model at a time. Anything you clear goes to the Trash first, so you can put it back.
Related guides
- Hidden folders AI coding tools leave on your Mac
- Is it safe to delete ~/Library/Caches?
- Is it safe to delete Xcode DerivedData?
See it on your own Mac
Macaroom scans your Mac, names what each chunk of storage is, and marks what's safe to clear. Anything you remove goes to the Trash, so you can put it back.
Get Macaroom