Skip to content

fix(arborist): honor sibling constraints for missing peers - #10277

Open
ychampion wants to merge 1 commit into
npm:latestfrom
ychampion:fix/transitive-peer-constraints
Open

ychampion wants to merge 1 commit into
npm:latestfrom
ychampion:fix/transitive-peer-constraints

Conversation

@ychampion

Copy link
Copy Markdown
Contributor

A fresh npm install primeng@18.0.2 can select Angular common 19 alongside core 18, then fail with ERESOLVE even though common 18 satisfies the peer group.

When a missing required peer has no direct constraint on its virtual parent, consult a sibling peer constraint before recursively loading the candidate’s own peers.
Reuse the existing two-edge version selection, retaining direct-parent priority and the skip for absent optional peers.

Fixes #10054.

Validation:

  • Reduced dependency-graph regression fails before the fix and passes after.
  • Two optional-peer owners do not trigger a fetch for an absent provider; removing the guard makes this strict-mock regression fail.
  • Fresh public-registry PrimeNG lockfile-only and full installs pass, all Angular packages resolve 18.2.14, and npm ls --all --json reports no problems.

Full validation: node . run test-all executed the CLI, docs, smoke tests and all workspaces.
The initial run hit Arborist’s chmod/EACCES assertion because this session runs as root, plus a 30-second file timeout in libnpmexec; the other suites passed.
Rerunning the full Arborist suite with DAC bypass capabilities removed and the full libnpmexec suite with a 120-second timeout passed, each with 100% coverage and lint/template checks.

Assisted by AI.

Signed-off-by: ychampion <68075205+ychampion@users.noreply.github.com>
@ychampion
ychampion requested a review from a team as a code owner November 11, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ERESOLVE with transitive peer dependencies

1 participant