Mac storage basics · Programming languages and toolchains

How do I clean the pnpm store and Bun cache on a Mac?

Short answer: Run pnpm store prune to drop unreferenced packages and bun pm cache rm to clear Bun's cache. Packages re-download on the next install.

Both keep a shared store of packages so installs are fast:

  • pnpm: pnpm store prune removes packages no project references any more.
  • Bun: bun pm cache rm clears Bun's global cache.

The next install re-downloads what's needed, so the only cost is a slower first install. npm, Yarn and pip are covered in cleaning npm, yarn and pip caches, and per-project folders in cleaning up node_modules.

Last reviewed

Also available as Markdown and JSON.