DevCleaner
Menu
Skip to content
Browse guides

pnpm clear cache: pnpm store prune vs deleting the store

pnpm store prune removes packages no project still references. Deleting the store directory is the full reset. Neither one deletes node_modules.

pnpm store path
pnpm store prune
rm -rf "$(pnpm store path)"
On this page

Find the store

Ask pnpm for the active store, then measure that directory:

pnpm store path
du -sh "$(pnpm store path)"

On a Mac the default is ~/Library/pnpm/store. PNPM_HOME, XDG_DATA_HOME, and storeDir can move it. pnpm keeps one store per disk, because a hard link cannot cross filesystems. A project on another disk gets its own store.

pnpm store prune

pnpm store prune

Prune removes packages that no project on the machine still references. An upgrade can leave the previous version in the store, and prune is what drops it. pnpm documents this as safe for your projects: a later install downloads a removed package again. Prune does not remove packages a project still uses, so it is not a reset of the store.

Run it occasionally. If you prune and then switch to a branch with older dependencies, the next install downloads those packages again.

Deleting the store

To remove the content-addressable store, delete the directory pnpm store path prints:

rm -rf "$(pnpm store path)"

pnpm creates the store again on the next install. If you have used pnpm on more than one disk, run that command on each disk. Packages in node_modules on the same disk are hard links into the store, so deleting the store directory removes the store's names and the space those links still hold stays until those node_modules folders are gone. The next install downloads what the new store does not already have.

Removing a project's node_modules is a separate decision. Read can I delete node_modules? The other package managers: how to clear npm cache and how to clear yarn cache.

FAQ

How do I reset the pnpm store?
Delete the directory printed by pnpm store path: rm -rf "$(pnpm store path)". pnpm creates the store again on the next install. On a Mac that directory is often ~/Library/pnpm/store. pnpm store prune is smaller: it only removes packages no project still references.
Why does the pnpm store keep growing?
pnpm keeps package versions in the store after a project stops using them. pnpm store prune removes the unreferenced ones. It leaves packages that a project still references.

Scan it with DevCleaner

DevCleaner can run pnpm store prune, or delete the store folders it finds at ~/Library/pnpm/store, ~/.local/share/pnpm/store, and ~/.pnpm-store. Those rows are Warning and stay unselected until you choose them. On a new Free install, Warning cleanup needs Pro. Prune runs the pnpm command and does not use Deletion mode. Deleting a store folder follows Settings → General → Deletion. On macOS 1.17.0 the default is By risk: Safe items are deleted permanently, and Warning and Danger items move to the Trash. Always move to Trash and Always delete permanently are the other choices.

Download DevCleaner ↓

References and scope

Reviewed October 19, 2026 against pnpm's store command, store location settings, and the uninstall instructions for removing the store. pnpm store path is the directory to measure or delete. A custom storeDir overrides the Mac default.

Featured on TryMacApps Featured on UsefulShelf Featured on Formac Listed on MacTools Pro Fazier badge