pnpm:  ERR_PNPM_BAD_PM_VERSION

When running pnpm install, pnpm throws an error:

$ pnpm install
 ERR_PNPM_BAD_PM_VERSION  This project is configured to use v8.15.6 of pnpm. Your current pnpm is v9.1.1

If you want to bypass this version check, you can set the "package-manager-strict" configuration to "false" or set the "COREPACK_ENABLE_STRICT" environment variable to "0"

The error is not clear what “configuration” should i choose. package.json‘s config field? Or pnpm config? I’m not sure.

From this PR, apparently you need to set it on .npmrc:

package-manager-strict=false

References:

Upgrading the PNPM

Use corepack up, as mentioned by edvinv.

corepack up

… or maybe follow the pnpm’s announcement:

corepack prepare [email protected] --activate

# and update the field:
corepack use [email protected]

Disclaimer:

Not all articles here are meant to be correct. My notes might be wrong or may no longer be relevant. If you want to try things here, please proceed with caution.


Posted

in

by

Tags: