Alex
Alex

Reputation: 1420

Pnpm package manager downgrade

What is the proper way of downgrading pnpm to an older version? I have currently the latest version 7+, while I need version 6.32. npm has a nice tools for it: volta or nvm, but haven't found anything for pnpm if it's intalled globally.

Upvotes: 6

Views: 28002

Answers (5)

Saiba Joichiro
Saiba Joichiro

Reputation: 1

If you have installed pnpm through Node.js corepack:

// enable corepack
corepack enable
// switch pnpm 6.32 version
corepack prepare [email protected] --activate
// switch pnpm latest version
corepack prepare pnpm@latest --activate

Upvotes: 0

Yaron Habot
Yaron Habot

Reputation: 123

On Windows in a bash terminal, I was able to downgrade from version 9.1.4 to 8.15.7 by executing: pnpm add -g [email protected]

Upvotes: 9

cuddlemeister
cuddlemeister

Reputation: 1785

As an alternative, if you just need to use another version of pnpm for a particular project, just switch to another version of node with nvm, since each version has its own global packages. That way you can have pnpm 8 for node 18 and pnpm 7 for node 16

Upvotes: 0

Hoernchen
Hoernchen

Reputation: 59

Since v16.13, Node.js is shipping Corepack for managing package managers.

https://pnpm.io/installation#using-corepack

corepack prepare [email protected] --activate

Use this command to just change the pnpm version.

All version Tags can be found on pnpms github page: https://github.com/pnpm/pnpm/tags?after=v6.32.2

Upvotes: 5

Lucas Bodin
Lucas Bodin

Reputation: 336

As indicated on this page https://pnpm.io/fr/uninstall you must delete the directory stored in the $PNPM_HOME environment variable. So type:

$PNPM_HOME

Then delete it with the following command on linux or macOs:

sudo rm -rf $PNPM_HOME

Or by deleting the folder directly with windows

Upvotes: 1

Related Questions