Skip to content
Black Friday · 25% off · Lifetime Pro for $5.99 $7.99Ends in …Code BLACKFRI25

Clear npm, yarn, pip, uv & conda caches on Mac

Language package managers keep download caches that quietly grow into multi-gigabyte folders. Use this hub to prune each cache without deleting project environments.

Developer GuideBy Ojas PalorkarUpdated November 24, 20266 min readTested on macOS 15.1, Node 22, Python 3.12

Quick answer

Run npm cache clean --force, yarn cache clean, pip cache purge, uv cache clean, and conda clean -a. Typical recovery is 3–20 GB. These commands do not remove project node_modules or virtualenvs.

Where the space goes

~/.npmnpm cache clean --force
1–8 GBYes
~/Library/Caches/Yarnyarn cache clean
1–6 GBYes
~/Library/Caches/pippip cache purge
0.5–5 GBYes
~/.cache/uv · ~/anaconda3uv cache clean · conda clean -a
1–10 GBYes
Typical sizes on a 0 to 10 GB scale. Your disk will differ.

npm cache

npm stores tarball caches under ~/.npm. Clear with npm cache clean --force, then optionally inspect size with du -sh ~/.npm.

Yarn cache

Classic Yarn uses yarn cache clean. Yarn Berry (PnP) keeps less traditional cache; still run yarn cache clean if you use the node-modules linker.

pip cache

pip cache purge drops wheels and source distributions. Confirm the path with pip cache dir.

uv and conda

uv cache clean clears uv's download cache. For Anaconda/Miniconda, conda clean -a removes unused packages and tarballs—review the dry-run prompt before confirming.

FAQ

Is it safe to clear npm and yarn caches?

Yes. Package caches are downloadable again. You may see slower installs until the cache warms. Active node_modules folders are not deleted by these commands.

Does pip cache purge remove virtualenvs?

No. pip cache purge only clears the HTTP wheel/sdist cache. Project .venv directories stay until you delete them deliberately.

How much space do these caches usually take?

On developer Macs we typically see 2–15 GB across npm/yarn/pnpm plus 1–8 GB for pip/uv/conda, depending on how many languages you use.

Run this cleanup in SpaceWise

Same targets, Recovery Bin rollback, no Terminal required. Free tier included.

Download for Mac