SiftMac
Is it safe to delete? · Package caches · Updated 21 November 2026

Is it safe to delete pnpm’s store?

By Mohit Nippanikar, who makes SiftMac

The short answer
On this page
  1. How pnpm’s store works
  2. Where it is
  3. How big it is, and what that number means
  4. How to clear it
  5. What you’ll notice afterwards
  6. Questions

1. How pnpm’s store works

pnpm doesn’t give each project its own downloaded copy of each package. It keeps one content-addressable store per disk, where every file is stored once, and fills each project’s node_modules from it. How it fills them depends on the disk:

Either way, a package used by twenty projects takes its space once. The flip side is that the store keeps every version your projects have moved through until something prunes it.

pnpm also keeps a smaller cache in ~/Library/Caches/pnpm: package metadata from the registry, pnpm dlx downloads and some install checks.

2. Where it is

~/Library/pnpm/store
~/Library/Caches/pnpm

Those are the macOS defaults; pnpm store path prints the store in use. Keep projects on an external drive and pnpm makes another store on that drive, because links and clones only work within one disk.

3. How big it is, and what that number means

du -sh "$(pnpm store path)" ~/Library/Caches/pnpm

Read that number with care. du adds up every file it finds and can’t see that a file in the store and its clone in a project share blocks. Removing a package from the store frees its space only when no project still holds a clone or hard link of it. While some project’s node_modules shares those blocks, they stay in use.

4. How to clear it

  1. Let any pnpm install that’s running finish.
  2. Run pnpm store prune. It removes unreferenced packages, those not used by any project on the system. pnpm’s docs say it has no side effects on your projects and suggest running it occasionally, not constantly.
  3. If you like, empty the metadata cache too. It refills on the next install.
pnpm store prune
rm -rf ~/Library/Caches/pnpm/*

Don’t move the store in Finder or delete it while projects still use it. A project set up with pnpm’s global virtual store, which is off by default, keeps only links into the store and stops working until it’s installed again.

5. What you’ll notice afterwards

Questions

Why didn’t deleting node_modules in a pnpm project free much space?

The files there are clones, or hard links, of files in the store. Their blocks stay in use by the store until pnpm store prune removes packages no project references.

Can I move pnpm’s store to an external drive?

Only together with your projects. pnpm wants the store on the same disk as the projects it serves; otherwise it copies packages instead of linking them, which uses more space, not less.

How often should I run pnpm store prune?

Now and then, for example after deleting old projects. pnpm recommends it occasionally but not too often, since anything pruned has to be downloaded again when a project wants it.

What is ~/Library/Caches/pnpm?

pnpm’s cache of package metadata, pnpm dlx downloads and some install checks. It’s safe to empty and refills as you install.

How SiftMac handles it. SiftMac clears pnpm’s metadata cache in ~/Library/Caches/pnpm with its App caches (verdict Rebuilds), and leaves the store in ~/Library/pnpm to pnpm store prune, which knows what projects still use. When it lists an old pnpm project’s node_modules under Developer files, the size shown counts only blocks the folder doesn’t share with the store, so you see what deleting really frees.

Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works