fix(arborist): fix peerOptional dependency resolution in buildIdealTree#8981
Open
Saibamen wants to merge 3 commits intonpm:latestfrom
Open
fix(arborist): fix peerOptional dependency resolution in buildIdealTree#8981Saibamen wants to merge 3 commits intonpm:latestfrom
peerOptional dependency resolution in buildIdealTree#8981Saibamen wants to merge 3 commits intonpm:latestfrom
Conversation
buildIdealTree problem detection
Author
|
FYI: Right now, this PR fixes only
I will try to fix this too. |
…ptional When a dependency is placed (OK) and creates an invalid peerOptional edge with an already-processed node, re-queue that node for re-resolution. This handles the case where the peerOptional holder is processed before the dep exists in the tree (due to alphabetical processing order), and the dep is later placed by another path with a version that doesn't satisfy the peer spec. Also adds npm install tests for issue npm#8726 covering both the existing-lockfile and fresh-install (no lockfile) scenarios. Refs: npm#8726 Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Now |
buildIdealTree problem detectionbuildIdealTree
buildIdealTreepeerOptional dependency resolution in buildIdealTree
owlstronaut
requested changes
Feb 17, 2026
Contributor
There was a problem hiding this comment.
Could you unwrap the multi-line comments so each sentence/paragraph is on a single line? We avoid hard-wrapping prose in comments for accessibility as it doesn't play well with screen readers (we've been slowly converting the codebase to that anyway, it is still pretty prevalent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8726
Tested on Windows & NodeJS v24.12.0 with
package.jsonfrom #8726 (comment):{ "name": "testcase", "version": "1.0.0", "devDependencies": { "addons-linter": "6.13.0", "htmlhint": "1.1.4" } }