What is the pnpm store on Mac, and is it safe to delete?
Yes, the pnpm store is safe to prune or delete. pnpm downloads any missing package again the next time you run pnpm install.
Where it is
~/Library/pnpm/storeWhat it is
pnpm keeps a single content-addressable store of package files on your disk. When you install dependencies, it links files from the store into each project's node_modules instead of copying them, which is why pnpm uses less space than one full copy per project.
The store grows because packages stay in it after the projects that used them have moved on to newer versions or been deleted. Those unreferenced packages are what pruning removes.
On macOS the default location is ~/Library/pnpm/store. You can confirm where yours is with pnpm store path.
How big it gets
Usually a few GB, more if you work on many projects with different dependency versions.
How to clear it by hand
- Open Terminal.
- Run the command below. It removes packages from the store that no project on your Mac references any more, and leaves the rest.
- To remove the whole store instead, run pnpm store path to find it and delete that folder. Projects then need pnpm install before their next change of dependencies.
pnpm store pruneWhat happens afterwards
After a prune, existing projects keep working because the packages they use are still in the store. Anything removed is downloaded again the next time a project needs it.
How Diskzy handles it
Diskzy lists the pnpm cache in the Clean up tab and ticks it, like the npm, Yarn and Bun 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