Skip to content

fix(arborist): give shadowed workspaces a local bin shim on hoisting collision#9719

Closed
gopalsunkari860 wants to merge 2 commits into
npm:latestfrom
gopalsunkari860:abcd
Closed

fix(arborist): give shadowed workspaces a local bin shim on hoisting collision#9719
gopalsunkari860 wants to merge 2 commits into
npm:latestfrom
gopalsunkari860:abcd

Conversation

@gopalsunkari860

Copy link
Copy Markdown

No description provided.

Vihaan varnika and others added 2 commits July 3, 2026 20:11
…collision

When two workspaces depend on different packages that export the same
bin name, both get hoisted to the root node_modules, but bin-links
only creates one shim there (first one wins by sort order). The
losing workspace had no local node_modules/.bin, so `npm exec -w`
silently fell through to the root shim and ran the wrong package's
script.

Detect the collision during rebuild's bin-linking pass and give any
workspace that directly depends on the shadowed package its own local
shim, symlinking the real package folder into the workspace's
node_modules and reusing bin-links' existing (unmodified) linking
logic.

Fixes: npm#9712

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gopalsunkari860
gopalsunkari860 deleted the abcd branch July 4, 2026 04:31
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.

1 participant