JavaScript Toolchains

npm, pnpm, Yarn, Bun caches: hidden duplicates across projects

Package managers are fast because they cache aggressively. On multi-project Macs, these stores can consume massive space even when repos are removed.

Updated:

Read time: 6 min

Why this silently grows

Dependency tarballs and extracted package data are retained for speed. Using multiple managers across mono-repos, experiments, and old branches produces overlapping caches that keep growing in the background.

How Free Mac Space finds it

Free Mac Space groups these paths under a dedicated Node Modules category, including ~/.npm/_cacache, ~/Library/pnpm/store, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.yarn/cache, ~/.bun/install/cache, and related ~/.cache directories.

How cleanup is handled

You can clean cache-heavy directories from one place after reviewing size and recency. Cleanup still follows the same guardrails: root validation, protected path checks, Trash-first action, and local audit logging.

Safety boundary

The app separates generic app cache scanning from dedicated language-tool caches to avoid accidental cross-category cleanup and make review decisions clearer.

Paths covered in Free Mac Space

  • ~/.npm/_cacache
  • ~/Library/pnpm/store
  • ~/.pnpm-store
  • ~/.yarn/berry/cache
  • ~/.yarn/cache
  • ~/.bun/install/cache
  • ~/.cache/pnpm

Recommended monthly check

  • Sort by directory size and remove stale manager stores first.
  • Keep active project caches if you need faster rebuilds this week.
  • Run another scan to confirm the expected reclaimed volume.

Step-by-step workflow

  1. 1. Identify why JavaScript Toolchains storage keeps growing

    Dependency tarballs and extracted package data are retained for speed. Using multiple managers across mono-repos, experiments, and old branches produces overlapping caches that keep growing in the background.

  2. 2. Inspect the highest-impact paths first

    Free Mac Space groups these paths under a dedicated Node Modules category, including ~/.npm/_cacache, ~/Library/pnpm/store, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.yarn/cache, ~/.bun/install/cache, and related ~/.cache directories. Priority paths: ~/.npm/_cacache, ~/Library/pnpm/store, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.yarn/cache, ~/.bun/install/cache, ~/.cache/pnpm.

  3. 3. Confirm the safety boundary before acting

    The app separates generic app cache scanning from dedicated language-tool caches to avoid accidental cross-category cleanup and make review decisions clearer.

  4. 4. Apply a review-first cleanup workflow

    You can clean cache-heavy directories from one place after reviewing size and recency. Cleanup still follows the same guardrails: root validation, protected path checks, Trash-first action, and local audit logging.

  5. 5. Monthly validation step 1

    Sort by directory size and remove stale manager stores first.

  6. 6. Monthly validation step 2

    Keep active project caches if you need faster rebuilds this week.

  7. 7. Monthly validation step 3

    Run another scan to confirm the expected reclaimed volume.

Frequently asked questions

  • What hidden storage sources are covered for JavaScript Toolchains?

    Primary sources include npm cache, pnpm store, Yarn cache, Bun install cache. Dependency tarballs and extracted package data are retained for speed. Using multiple managers across mono-repos, experiments, and old branches produces overlapping caches that keep growing in the background.

  • Which macOS paths should I inspect first?

    Start with: ~/.npm/_cacache, ~/Library/pnpm/store, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.yarn/cache, ~/.bun/install/cache, ~/.cache/pnpm. Free Mac Space groups these paths under a dedicated Node Modules category, including ~/.npm/_cacache, ~/Library/pnpm/store, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.yarn/cache, ~/.bun/install/cache, and related ~/.cache directories.

  • How can I reduce this storage safely?

    You can clean cache-heavy directories from one place after reviewing size and recency. Cleanup still follows the same guardrails: root validation, protected path checks, Trash-first action, and local audit logging. The app separates generic app cache scanning from dedicated language-tool caches to avoid accidental cross-category cleanup and make review decisions clearer.

  • What should the monthly review checklist look like?

    Sort by directory size and remove stale manager stores first. Keep active project caches if you need faster rebuilds this week. Run another scan to confirm the expected reclaimed volume.

Continue in the matching solution

If you're ready to act, continue in "npm / pnpm / Yarn / Bun cache cleanup" with a step-by-step workflow.

Open matching solution page

More hidden storage cases

Xcode

Xcode DerivedData and DeviceSupport: the classic hidden giant

Xcode can quietly keep tens of gigabytes in build artifacts and simulator/device support files. This post explains where it grows and how to clean without breaking active projects.

Read article

Docker

Docker Desktop VM disk: why it keeps growing after projects end

Docker images, layers, and build cache are stored inside Docker-managed directories and VM disk files. They can grow fast and stay invisible to normal Finder checks.

Read article

Homebrew

Homebrew cache folders: small installs, surprisingly large history

Homebrew keeps download and metadata caches that can survive across upgrades. They are safe cleanup candidates when they become oversized.

Read article