Is the pnpm store safe to delete on your Mac?
~/Library/pnpm~/Library/Caches/pnpmYes, you can reclaim this space, but don't drag ~/Library/pnpm to the Trash as your first move. Run pnpm store prune instead: it removes only the package versions no project on your Mac still uses, and it won't break your projects. The full-folder delete is a last resort with real side effects, covered below.
What it is
pnpm saves disk space in a way npm doesn't. Instead of copying packages into every project's node_modules, it keeps one master copy of each package version in a content-addressable store and hard-links files from there into your projects. Ten projects using the same version of react share one physical copy. That store lives inside the ~/Library/pnpm folder you found, in a subfolder named store.
It grows because nothing ever leaves on its own. Every version of every package any pnpm project on your Mac has installed stays in the store, even after you delete the projects themselves. pnpm also keeps a separate download cache of package tarballs and metadata at ~/Library/Caches/pnpm. And if you installed pnpm with its standalone installer, ~/Library/pnpm doubles as pnpm's home folder: the pnpm binary and any globally installed packages live there too. After a year of active work, several gigabytes here is normal, and heavy monorepo setups can go well past that.
Is it safe to delete?
Mostly, but the method matters. The safe move is pnpm store prune, the official cleanup, which deletes only package versions that no project on your Mac references anymore. Trashing all of ~/Library/pnpm is more drastic. Your existing projects keep running for now, because hard-linked files survive until the last link to them is gone, but every pnpm project on this Mac re-downloads what it needs on its next install. And if the standalone installer put pnpm's own binary in that folder, you just deleted pnpm itself along with your global packages.
~/Library/Caches/pnpm is the simpler case. It's a plain download cache of tarballs and metadata, safe to clear whenever you like; pnpm rebuilds it on the next install. Diskmack identifies both folders automatically and cleans them the safe way.
How to check its size
In Finder: In Finder, choose Go > Go to Folder (Shift-Command-G), paste ~/Library/pnpm, and press Return. Select the folder and press Command-I to see its size. Repeat with ~/Library/Caches/pnpm for the download cache.
In Terminal:
du -sh ~/Library/pnpm ~/Library/Caches/pnpmThe ~ expands to your home folder automatically. If the first path comes up empty, pnpm store path prints where your store actually lives.
How to clean it
- Open Terminal (Applications > Utilities) and run: pnpm store prune. It deletes only package versions no project still references, so there is nothing to double-check first.
- If you have abandoned pnpm projects sitting around, delete their node_modules folders (or the whole projects) first, then run pnpm store prune again. Packages count as in use until no project links to them, so pruning before the cleanup frees almost nothing.
- For the download cache, press Shift-Command-G in Finder, go to ~/Library/Caches/pnpm, and move its contents to the Trash. pnpm re-downloads what it needs on the next install.
- Only if you are done with pnpm entirely: move ~/Library/pnpm itself to the Trash. Expect your global packages, and possibly the pnpm binary, to go with it.
The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.
pnpm store prunepnpm store prune only removes versions no project currently references. Delete dead projects first, then prune, or the number barely moves.
Will it come back?
Yes, and that's by design. The store refills as you install packages, and it should: the whole point of pnpm is keeping one shared copy instead of a duplicate inside every node_modules, so a populated store usually means less total disk use, not more. It only ever grows on its own, though, because old versions never age out. A pnpm store prune every few months, ideally right after you delete old projects, keeps it in check. The cache at ~/Library/Caches/pnpm reappears with your next install; that's normal.
Common questions
Will deleting the store break projects that already have node_modules?
Not right away. pnpm hard-links files from the store into node_modules, so the actual file contents stay on disk as long as either side still points at them. The flip side: deleting store entries for packages still in use frees very little space. The real cost lands on the next pnpm install, when everything missing gets re-downloaded.
What's the difference between ~/Library/pnpm and ~/Library/Caches/pnpm?
~/Library/pnpm holds the package store, plus pnpm's own files and global packages if you used the standalone installer. Treat it with care. ~/Library/Caches/pnpm is just a download cache of tarballs and metadata; clearing it is always safe and pnpm rebuilds it on the next install.
Why is my pnpm store so big?
One copy of every package version any project ever installed stays in the store until you prune. As projects bump dependencies, old versions pile up behind them, and deleted projects leave their packages behind too. On machines with lots of JavaScript work the store often reaches several gigabytes.
Does pnpm store prune ever delete something a project needs?
Not for any project with an installed node_modules. Prune counts a version as in use only while some node_modules still hard-links to it, so those stay put. The one edge case: if you deleted a project's node_modules but kept the project, prune treats its packages as orphaned and removes them, and your next pnpm install re-downloads them. That costs bandwidth, not correctness.
Related folders
- Can I delete the .npm folder on my Mac? Yes, it's safe
- Is ~/.yarn Safe to Delete? How to Clear the Yarn Cache on a Mac
- Is It Safe to Delete node_modules on Your Mac?
- Clear the Bun Install Cache: Is ~/.bun/install/cache Safe to Delete?
- Can You Delete the .next Folder? Yes, and Here's Why
- Can I Delete the .turbo Folder? Yes, It's Safe