#6929·pnpm

Record/log node_modules locations in store for easy removal

Author: stevenleleCreated Aug 9, 2023Updated Sep 26, 2026
Labelstype: featurepriority: 3idea: from tracker 15277

Describe the user story

When trying to remove all packages in store, you need to manually remove all node_modules installations by pnpm, then run pnpm store prune. Even if you managed to remove them from all projects you remember having in your disk, there might be some secret installations you don't know. Windows users can use tools like Everything to search for node_modules or .pnpm folders, but macOS users don't have such tool. For example, I had to use ls -l then find ~ -samefile on files in the store to find that ~/Library/Caches/typescript had hard linked files from the store.

Describe the solution you'd like

Whenever pnpm install is triggered in any way or from any source, log the node_modules location to the corresponding store. It could be a simple text file for user to check upon later.

Describe the drawbacks of your solution

There might be some privacy consideration but I think it's generally fine.

Describe alternatives you've considered

Maybe a command to automatically find existing installations (e.g. find ~ -samefile store file on Unix-like systems), but that would be much more complicated.