Skip to content

fix(arborist): forward transitive overrides through linked store links (#9658) (backport release/v11)#9668

Merged
owlstronaut merged 1 commit into
npm:release/v11from
manzoorwanijk:backport/linked-transitive-override-v11
Jun 25, 2026
Merged

fix(arborist): forward transitive overrides through linked store links (#9658) (backport release/v11)#9668
owlstronaut merged 1 commit into
npm:release/v11from
manzoorwanijk:backport/linked-transitive-override-v11

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Contributor

Backport of #9658 to release/v11.

Under install-strategy=linked, an override forcing a transitive dependency outside its dependent's declared range was applied on disk but reported as invalid by npm ls --all, which then exited 1 (ELSPROBLEMS); hoisted reports it as overridden and exits 0. It only surfaced when the overridden package's dependent was itself a transitive (store) package.

Link.recalculateOutEdgesOverrides only forwarded an OverrideSet to a store link's target when a rule named a direct dependency of the target, so the chain to a deeper dependent -> overridden edge never received the rule. The fix walks the target's subtree and forwards when a rule actually applies to a reachable edge (matched via getEdgeRule on name and spec, preserving #9357), and loadActual re-forwards through links once the tree is complete.

Cherry-picked cleanly except for a context-only conflict in load-actual.js and its test file: the unrelated packageExtensions and .npm-extension methods and the applies root packageExtensions to a linked actual tree test are not present on release/v11, so they were dropped from the resolution. Only this fix's changes are included.

References

Backports #9658

npm#9658)

Backport of npm#9658 to release/v11. Resolved a context-only conflict by dropping the unrelated packageExtensions/npm-extension methods and test, which are not present on release/v11.
@owlstronaut owlstronaut merged commit ede32d3 into npm:release/v11 Jun 25, 2026
16 checks passed
@manzoorwanijk manzoorwanijk deleted the backport/linked-transitive-override-v11 branch June 25, 2026 18:53
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.

2 participants