I'm currently working on an application that uses pnpm 6 but I have pnpm 7 installed. I couldn't find any documentation that shows me how to install and switch between versions. Thank you!
5 Answers
If you have installed pnpm through Node.js corepack:
corepack enable
you can just run:
corepack prepare pnpm@7.13.6 --activate
Here is the doc

- 201
- 4
- 6
I'm also going with node.js/corepack. I have to jump between versions 6 and 7 for different projects.
With a recent version of node.js (16.17+) it's even easier to switch between the most recent of major versions of pnpm. For the latest of version 7 you'd type:
corepack prepare pnpm@latest --activate
For the latest of version 6:
corepack prepare pnpm@latest-6 --activate
It's also described in the installation doc of pnpm.

- 91
- 1
- 2
-
this script worked well to get the lastest of a specific version! great find! the installation doc doesn' describe it though.. – SetiZ Jun 20 '23 at 13:22
There may be a better way but I just uninstalled version 7 and installed version 6. I did this with yarn but you can do it with any method listed in the uninstall/install documentation. Just make sure you uninstall using the method you originally used to install it (npm, yarn, brew, etc.).
This is what I did:
yarn global remove pnpm
yarn global add pnpm@6.32.1 (installed specific latest pnpm version)
Currently, it seems there is no solution similar to nvm. Reference

- 320
- 1
- 7
In my case, to setup the nextauthjs local environment on Ubuntu 22.04 I did the followings.
- I had previously installed pnpm using a standalone script.
- To avoid collisions I removed the pnpm CLI.
- I made sure nvm version is up to date.
- I configured current node engine of the nextauthjs.
nvm use v18.12.0
- I enabled current packageManager version of the nextauthjs using corepack
corepack enable && corepack prepare pnpm@7.23.0 --activate
(corepack enable pnpm
is should be enough too).

- 193
- 2
- 8
I installed pnpm with Vite in 2022 or 2023 on Windows.
I did the global installations but 'pnpm -v' always returned the old version:
pnpm i -g pnpm
pnpm i -g @pnpm/exepnpm ls -g
// @pnpm/exe 8.5.1
// pnpm 8.5.1pnpm -v
// 7.25.1
The 'pnpm -v' finally gave me 8.5.1 after running the following commands:
corepack enable
corepack prepare pnpm@8.5.1 --activate

- 1
- 1