Skip to content

Bug: --pm-on-fail=ignore fails to ignore #11487

@glensc

Description

@glensc

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

v11.0.6

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

No response

Reproduction steps

  1. Install pnpm 11
  2. Create package.json with devEngines, packageManager fields
{
    "packageManager": "pnpm@10.28.2",
    "devEngines": {
        "runtime": {
            "name": "node",
            "version": "^24"
        },
        "packageManager": {
            "name": "pnpm",
            "version": "10.28.2"
        }
    },

Describe the Bug

Unable to use --pm-on-fail=ignore properly for flags, seems --help and --version are affected

First, we run a command to see wrong version is present. It gives usable help how to skip the error.

$ pnpm audit
[ERROR] This project is configured to use 10.28.2 of pnpm. Your current pnpm is v11.0.6
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"

It works:

$ pnpm audit --pm-on-fail=ignore | head -n1
┌──────────────────────────────────────────────────┐
...

But the flag doesn't work with other flags:

$ pnpm audit --pm-on-fail=ignore --help
[ERROR] This project is configured to use 10.28.2 of pnpm. Your current pnpm is v11.0.6
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"
$ pnpm audit --help --pm-on-fail=ignore
[ERROR] This project is configured to use 10.28.2 of pnpm. Your current pnpm is v11.0.6
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"

It was even difficult to obtain a version to report this bug:

$ pnpm --version
[ERROR] This project is configured to use 10.28.2 of pnpm. Your current pnpm is v11.0.6
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"

$ pnpm --version --pm-on-fail=ignore
[ERROR] This project is configured to use 10.28.2 of pnpm. Your current pnpm is v11.0.6
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"

Expected Behavior

--pm-on-fail=ignore must always work

Which Node.js version are you using?

24

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions