nodejs / corepack

Zero-runtime-dependency package acting as bridge between Node projects and their package managers
MIT License
2.57k stars 169 forks source link

How to List All PNPM Versions Installed via Corepack #553

Open chenlei0608 opened 2 months ago

chenlei0608 commented 2 months ago

I've installed multiple versions of PNPM using Corepack. Could you please provide a way to list all the PNPM versions installed through Corepack?

aduh95 commented 2 months ago

On non-Windows: ls "${COREPACK_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/node/corepack}/pnpm/"

On Windows, I'm less familiar, it should either be in %COREPACK_HOME%, or %LOCALAPPDATA%/node/corepack/pnpm, or ~/.cache/node/corepack/pnpm.

chenlei0608 commented 2 months ago

Thanks, it is in %LOCALAPPDATA%/node/corepack/pnpm. It would be great if we could directly use commands to view, uninstall, and install pnpm versions, just like with nvm.

aduh95 commented 2 months ago

There are no proper CLI for that atm. On a related note, it is possible to install and uninstall versions with the following commands:

chenlei0608 commented 2 months ago

Thanks, it helped me