Reporting on behalf of @nene in sql-formatter-org/sql-formatter#949 (comment)
Verify latest release
pnpm version
11.1.2
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
Original report from @nene: sql-formatter-org/sql-formatter#949 (comment)
Reproduction steps
Clone the sql-formatter PR branch switch-from-yarn-v1-to-pnpm-v11 (no config of pmOnFail in pnpm-workspace.yaml):
git clone --branch switch-from-yarn-v1-to-pnpm-v11 https://github.com/sql-formatter-org/sql-formatter.git
cd sql-formatter
Install pnpm@11.1.2 with Homebrew:
Run install with pnpm 11.1.2:
Reported result:
[ERROR] This project is configured to use 11.0.8+sha512.4c4097e1dd2d42372c4e7fa5a791ff28fc75a484c7ac192e64b1df0fdef17594ba982f9b4fed9adfb3c757846f565b799b2763fb3733d1de1bcb82cf46684912 of pnpm. Your current pnpm is v11.1.2
If you want to bypass this version check, you can set the "pmOnFail" configuration to "warn" or "ignore" (e.g. via --pm-on-fail=ignore). If using "devEngines.packageManager", you can set its "onFail" to "warn" or "ignore"
Installation succeds if pmOnFail of 'download' is set via flag:
pnpm install --pm-on-fail=download
Explicitly setting pmOnFail: download in pnpm-workspace.yaml config also succeeds.
Environment / Installation
pmOnFail is undefined:
$ pnpm config get pmOnFail
undefined
There are also no relevant environment variables set, including pnpm_config_pm_on_fail or COREPACK_*.
pnpm was installed with Homebrew:
Corepack is installed, but pnpm is not being invoked through a Corepack shim:
$ corepack --version
0.34.6
$ command -v pnpm
/opt/homebrew/bin/pnpm
$ ls -al "$(command -v pnpm)"
lrwxr-xr-x 1 nene admin 30 May 14 22:26 /opt/homebrew/bin/pnpm@ -> ../Cellar/pnpm/11.1.2/bin/pnpm
Describe the Bug
pmOnFail is documented as defaulting to download.
However, in this project, pnpm install does not behave the same as pnpm install --pm-on-fail=download.
The project uses devEngines.packageManager to require pnpm 11.0.8+sha512.4c4097e1dd2d42372c4e7fa5a791ff28fc75a484c7ac192e64b1df0fdef17594ba982f9b4fed9adfb3c757846f565b799b2763fb3733d1de1bcb82cf46684912.
Reported behavior:
pnpm install fails with a package manager version mismatch.
pnpm install --pm-on-fail=download succeeds.
- Explicitly setting
pmOnFail: download in config also succeeds.
pnpm config get pmOnFail returns undefined when run from another directory, or when devEngines.packageManager is removed.
Expected Behavior
When pmOnFail is not explicitly configured, pnpm install should behave the same as pnpm install --pm-on-fail=download.
Which Node.js version are you using?
22.22.3
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
Reporting on behalf of @nene in sql-formatter-org/sql-formatter#949 (comment)
Verify latest release
pnpm version
11.1.2
Which area(s) of pnpm are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
Original report from @nene: sql-formatter-org/sql-formatter#949 (comment)
Reproduction steps
Clone the
sql-formatterPR branchswitch-from-yarn-v1-to-pnpm-v11(no config ofpmOnFailinpnpm-workspace.yaml):git clone --branch switch-from-yarn-v1-to-pnpm-v11 https://github.com/sql-formatter-org/sql-formatter.git cd sql-formatterInstall
pnpm@11.1.2with Homebrew:Run install with pnpm 11.1.2:
Reported result:
Installation succeds if
pmOnFailof'download'is set via flag:Explicitly setting
pmOnFail: downloadinpnpm-workspace.yamlconfig also succeeds.Environment / Installation
pmOnFailisundefined:There are also no relevant environment variables set, including
pnpm_config_pm_on_failorCOREPACK_*.pnpm was installed with Homebrew:
Corepack is installed, but pnpm is not being invoked through a Corepack shim:
Describe the Bug
pmOnFailis documented as defaulting todownload.However, in this project,
pnpm installdoes not behave the same aspnpm install --pm-on-fail=download.The project uses
devEngines.packageManagerto require pnpm11.0.8+sha512.4c4097e1dd2d42372c4e7fa5a791ff28fc75a484c7ac192e64b1df0fdef17594ba982f9b4fed9adfb3c757846f565b799b2763fb3733d1de1bcb82cf46684912.Reported behavior:
pnpm installfails with a package manager version mismatch.pnpm install --pm-on-fail=downloadsucceeds.pmOnFail: downloadin config also succeeds.pnpm config get pmOnFailreturnsundefinedwhen run from another directory, or whendevEngines.packageManageris removed.Expected Behavior
When
pmOnFailis not explicitly configured,pnpm installshould behave the same aspnpm install --pm-on-fail=download.Which Node.js version are you using?
22.22.3
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response