Is it safe to delete ~/Library/pnpm on Mac?
Safe with care~/Library/pnpm
Not as a whole. ~/Library/pnpm holds pnpm's package store and your global tools. How to measure it and free space with pnpm store prune instead.
Verdict: Safe with care. Don't delete ~/Library/pnpm as a whole: on a Mac it holds pnpm's package store as well as your globally installed pnpm tools. To get space back, run pnpm store prune, which removes only the packages no project uses and, in pnpm's own words, is not harmful.
What lives in ~/Library/pnpm
pnpm downloads each version of each package once, keeps it in a shared store, and links it into every project that needs it. pnpm's store settings and other settings give these macOS defaults, which apply when PNPM_HOME and the XDG variables are not set:
store: the package store, in a versioned folder such asstore/v10.pnpm store pathprints the one in use.bin: links to the tools you installed withpnpm add -g.global: the global packages behind those tools.
pnpm's metadata cache is separate, in ~/Library/Caches/pnpm. If you installed pnpm with its standalone script, run echo $PNPM_HOME: if it prints this folder, pnpm itself lives here too. pnpm's uninstall guide removes a standalone install by deleting the PNPM_HOME folder, which shows how much rides on it.
On the macOS 15.5 Mac we checked this on, ~/Library/pnpm came to 1.2 GB. It had a bin folder and a store with two versioned folders, v10 and v11. pnpm store path pointed at v11. The metadata cache in ~/Library/Caches/pnpm was 140 KB.
What happens if you delete it
- The store: projects you have already installed keep their files, and the next
pnpm installdownloads whatever is missing. Installs are slower and need a network connection until the store fills again. - Less space back than it looks. pnpm's node_modules settings explain that on macOS it imports packages by cloning first, then hard-linking, then copying. An APFS clone shares its disk blocks with the original, so a file any project uses costs almost nothing extra in the store. Deleting the store frees only the parts no project shares, and
ducounts clones at full size, so its figure overstates what you would get. binandglobal: deleting these removes your global tools, and possibly thepnpmcommand itself. You would have to reinstall pnpm and every global package.
An older versioned store folder, such as v10 when pnpm store path prints v11, is not used by your current pnpm. A project pinned to an older pnpm version may still use it, so check before you remove one.
How to check its size safely
These commands only read:
du -sh ~/Library/pnpm/* ~/Library/Caches/pnpm 2>/dev/null
pnpm store path
pnpm ls -g
The first prints each part's size, the second prints the active store, and the third lists your global packages, so you know what lives in bin and global.
In Finder, choose Go > Go to Folder, type ~/Library/pnpm and press Return, then select a folder and choose File > Get Info.
The safest way to get the space back
- Let any running install or dev server finish.
- Run
pnpm store prune. The pnpm store docs say it removes unreferenced packages, meaning ones no project on your Mac uses, and also clears the package metadata cache. pnpm downloads anything removed again if a later install needs it. - If an old versioned store folder is left over and no project uses an older pnpm, move it to the Bin rather than deleting it outright:
trash ~/Library/pnpm/store/v10
The trash command comes with macOS 14 Sonoma and later. Replace v10 with the folder that pnpm store path does not print.
- Run
pnpm installin a project you use, check it works, then empty the Bin.
Warning: rm -rf ~/Library/pnpm deletes the store, your global tools and possibly pnpm itself in one go, with no way back. Use pnpm store prune instead.
What never to touch
binandglobal, unless you mean to remove your global tools. Usepnpm rm -gfor single packages.- The active store while an install is running.
node_modules/.pnpminside a project. It is part of that project's install. Remove the wholenode_modulesif you need to, as the node_modules page explains.pnpm-lock.yaml, which keeps installs repeatable.
The npm cache and Yarn cache pages cover the other package managers, and the guide to deleting node_modules safely covers project folders.
How Headroom helps
Headroom's Clean scan lists pnpm's metadata cache in ~/Library/Caches/pnpm under Developer caches once it passes 1 MB, with the note that it rebuilds on the next install. Headroom never cleans ~/Library/pnpm itself: the store, your global tools and pnpm stay put, so use pnpm store prune for the store. The free Space map shows how big the folder is beside everything else in your Library. The scan is free, and the $19 one-time licence clears what you tick, on up to three Macs. Read about the cleaner or download Headroom.
Questions
Where is the pnpm store on a Mac?
By default in ~/Library/pnpm/store, inside a versioned folder such as v10. Run pnpm store path to print the exact location your copy of pnpm uses.
Is pnpm store prune safe?
Yes. pnpm's documentation says it is not harmful and has no side effects on your projects. It removes packages no project uses, and pnpm downloads them again if a later install needs them.
Why doesn't deleting the pnpm store free as much space as du shows?
On a Mac, pnpm clones files from the store into each project's node_modules, and clones share disk space with the original. Only the parts no project shares come back.
What is ~/Library/pnpm/bin?
It holds links to the tools you installed globally with pnpm. If you installed pnpm with its standalone script, pnpm itself can live in this folder too, so deleting it can remove the pnpm command.