Skip to content

peerDependencyRules / ignoreMissing still fails with strictPeerDependencies=true on pnpm 10.11.0 #9559

@Techn1x

Description

@Techn1x

Verify latest release

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

pnpm version

10.11.0

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. Be on pnpm 10.11.0
  2. Have a peerDependency issue for one package - eg missing webpack
  3. Have an ignoreMissing rule to ignore that issue, along with strict peers true - eg this example pnpm-workspace.yaml
autoInstallPeers: false
strictPeerDependencies: true
peerDependencyRules:
  ignoreMissing:
    - webpack
  1. Run pnpm i --resolution-only || echo "EXIT CODE IS ($?)"
  • noting that --resolution-only ensures a peer dependency resolution is done
  1. Observe that the output error code is 1

Describe the Bug

I have a project with pnpm 10.11.0, a missing webpack dependency, and strictPeerDependencies: true. It fails with error code 1 even when ignoreMissing specifies the webpack dependency.

This was meant to be resolved in 10.11.0 via #9505 but it seems the bug is still present

I present 3 scenarios, each has a workspace config and output.


Scenario 1; Here is the typical output, showing that webpack is the only missing peer. This scenario asserts the initial setup, without ignoreMissing. Error code 1 is produced as expected.

autoInstallPeers: false
strictPeerDependencies: true
$ pnpm -v
10.11.0
$ pnpm i --resolution-only; echo "EXIT CODE IS ($?)"
......
 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
├─┬ ember-source 6.2.0
│ └─┬ ember-auto-import 2.10.0
│   ├─┬ babel-loader 8.3.0
│   │ └── ✕ missing peer webpack@>=2
│   ├─┬ css-loader 5.2.7
│   │ └── ✕ missing peer webpack@"^4.27.0 || ^5.0.0"
│   ├─┬ mini-css-extract-plugin 2.8.1
│   │ └── ✕ missing peer webpack@^5.0.0
│   └─┬ style-loader 2.0.0
│     └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
├─┬ @embroider/compat 4.0.3
│ └─┬ ember-source 6.1.0-beta.1
│   └─┬ ember-auto-import 2.10.0
│     └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
├─┬ ember-auto-import 2.10.0
│ └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
├─┬ ember-exam 9.1.0
│ └─┬ ember-auto-import 2.10.0
│   └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
├─┬ ember-intl 7.1.8
│ └─┬ ember-auto-import 2.10.0
│   └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
└─┬ ember-metrics 2.0.0
  └─┬ ember-auto-import 2.10.0
    └── ✕ missing peer webpack@"^4.0.0 || ^5.0.0"
Peer dependencies that should be installed:
  webpack@">=5.0.0 <6.0.0-0"
hint: To auto-install peer dependencies, add the following to "pnpm-workspace.yaml" in your project root:

  autoInstallPeers: true
hint: To disable failing on peer dependency issues, add the following to pnpm-workspace.yaml in your project root:

  strictPeerDependencies: false
EXIT CODE IS (1)

Scenario 2; ignoreMissing webpack config added. This scenario demonstrates the issue. Error code 1 is produced, when it should be 0.

autoInstallPeers: false
strictPeerDependencies: true
peerDependencyRules:
  ignoreMissing:
    - webpack
$ pnpm i --resolution-only; echo "EXIT CODE IS ($?)"
 WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
 WARN  28 deprecated subdependencies found: ........
Progress: resolved 1853, reused 0, downloaded 0, added 0, done
EXIT CODE IS (1)

Scenario 3; set ignoreMissing as wildcard "*". This scenario presents a temporary non-ideal workaround, which might provide a clue about what the underlying issue is. Error code 0 is produced, as expected.

autoInstallPeers: false
strictPeerDependencies: true
peerDependencyRules:
  ignoreMissing:
    - "*"
$ pnpm i --resolution-only; echo "EXIT CODE IS ($?)"
 WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
 WARN  28 deprecated subdependencies found: ...
Progress: resolved 1853, reused 0, downloaded 0, added 0, done
EXIT CODE IS (0)

Expected Behavior

The exit code should be 0 when the package is listed in ignoreMissing

Which Node.js version are you using?

24.0.2

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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions