Skip to content

Record/log node_modules locations in store for easy removal #6929

@stevenlele

Description

@stevenlele

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions