Find the store
Do not assume the default path. Ask pnpm, then measure that folder:
pnpm store path
du -sh ~/Library/pnpm/store
On a Mac the store is often ~/Library/pnpm/store, commonly 2 to 15 GB. The size range is illustrative, from the existing package-manager guide, not a guarantee.
pnpm store prune
pnpm store prune
Prune drops package versions that no project references anymore. The store is a download cache SAFE in the sense that packages can be fetched again. Deleting node_modules is still a separate step: pnpm hard-links project folders from this store, and removing a project node_modules does not by itself empty the store.
If you are deciding whether a project folder can go, read can I delete node_modules?
The other caches
How to clear npm cache uses npm cache clean --force. How to clear yarn cache uses yarn cache clean. The short index of all three is npm, yarn, and pnpm cache.
FAQ
- How do I clear the pnpm cache?
- Run pnpm store prune. It removes packages in the content-addressable store that no project still references. Find the store with pnpm store path. On a Mac it is often ~/Library/pnpm/store, commonly 2 to 15 GB.
- Why does the pnpm store keep growing?
- It keeps every package version ever installed by any project until you run pnpm store prune, which drops the ones no project references anymore.
Scan it with DevCleaner
DevCleaner measures the pnpm store with the rest of your developer caches and shows the size before you prune. Safe cleanup is free.
Download DevCleaner ↓References and scope
The prune command and the default Mac store path are the ones already published in the combined cache guide and on the pnpm store docs. Configuration can move the store. Size ranges are illustrative, not a recovery guarantee.