fix(arborist): unwrap Link nodes in legacyPeerDeps for linked strategy#9051
Merged
owlstronaut merged 2 commits intonpm:latestfrom Mar 3, 2026
Merged
Conversation
859d037 to
6894d93
Compare
owlstronaut
requested changes
Mar 3, 2026
Contributor
owlstronaut
left a comment
There was a problem hiding this comment.
The fix is good - already verified. we try to keep our codebase screen reader friendly when introducing new comments. Can approve and merge after
owlstronaut
approved these changes
Mar 3, 2026
wraithgar
pushed a commit
that referenced
this pull request
Mar 4, 2026
This contains the changes from - a2154cd (#8996) - 880ecb7 (#9013) - 26fa40e (#9041) - 983742b (#9055) - 10d5302 (#9051) - a29aeee (#9028) - 16fbe13 (#9030) - 8614b2a (#9031) Since Node 22 doesn't have npm 11 yet, it would be better to have this change backported to v10 Also, we wish to use `install-strategy=linked` in the [Gutenberg monorepo](WordPress/gutenberg#75814), which powers the WordPress Block Editor. We are still on v10. So, these fixes will help.
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.
When
legacyPeerDepsis enabled and a workspace has a peer dependency on another workspace,node.resolve()inassignCommonPropertiesreturns the Link node (atnode_modules/<ws>) rather than its target (atpackages/<ws>). The normal edge-based path correctly unwraps viae.to.target, but the legacyPeerDeps fallback pushed the raw resolved node directly.This caused
workspaceProxyto be called with the Link (a different object from the fsChild), creating a second workspace proxy withlocalLocation="node_modules/<ws>". Store links for that workspace's deps were then placed atnode_modules/<ws>/node_modules/<dep>instead ofpackages/<ws>/node_modules/<dep>, racing with the workspace symlink atnode_modules/<ws>and hitting EEXIST on subsequent installs.Fix: use
resolved.targetto unwrap Link nodes, consistent with the edge-based path.References
Fixes #9050