Diskzyv0.1
Safe to delete

What is ~/.bun/install/cache on Mac? Is it safe to delete?

Short answer

Yes, the Bun cache is safe to delete. It holds copies of packages Bun has already downloaded, and Bun fetches them again the next time a project needs them.

Where it is

~/.bun/install/cache

What it is

Bun, the JavaScript runtime and package manager, keeps every package version it downloads in a global cache at ~/.bun/install/cache. When you run bun install in a project, Bun links or copies packages from this cache instead of downloading them again, which is a large part of why it is fast.

It grows with every package and version your projects have used. Bun does not remove old entries by itself.

The rest of ~/.bun is different: ~/.bun/bin holds the bun program and any tools you installed globally. Leave that alone unless you are removing Bun.

How big it gets

Often several hundred MB to several GB, depending on how many projects you install with Bun.

How to clear it by hand

  1. Run the command below. It deletes everything in Bun's global package cache.
  2. To check the location first, run bun pm cache, which prints the cache folder.
  3. Run bun install in a project when you next work on it. Bun downloads its packages again.
In Terminal
bun pm cache rm

What happens afterwards

The next bun install in each project needs the network and takes longer than usual. Projects that are already installed keep working, because their node_modules folders are not touched.

How Diskzy handles it

Diskzy lists the Bun cache in the Clean up tab and ticks it, like the npm, Yarn and pnpm caches.

Related guides

See where your Mac's space went

Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.

Try Diskzy for free
Read this in:EnglishEspañolDeutschPortuguêsFrançaisTürkçe日本語