mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
fix: print a hint about the package-manager-strict setting (#7960)
close #7956
This commit is contained in:
6
.changeset/yellow-dolphins-battle.md
Normal file
6
.changeset/yellow-dolphins-battle.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/cli-utils": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Print a hint about the `package-manager-strict` setting, when pnpm doesn't match the version specified in the `packageManager` field in `package.json`.
|
||||
@@ -38,7 +38,9 @@ export function packageIsInstallable (
|
||||
if (pmVersion && pnpmVersion && pmVersion !== pnpmVersion) {
|
||||
const msg = `This project is configured to use v${pmVersion} of pnpm. Your current pnpm is v${pnpmVersion}`
|
||||
if (opts.packageManagerStrict) {
|
||||
throw new PnpmError('BAD_PM_VERSION', msg)
|
||||
throw new PnpmError('BAD_PM_VERSION', msg, {
|
||||
hint: '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"',
|
||||
})
|
||||
} else {
|
||||
globalWarn(msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user