GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(exec): resolve workspace-local bin under the linked install strategy by manzoorwanijk · Pull Request #9639 · npm/cli

Conversation

@manzoorwanijk

@manzoorwanijk manzoorwanijk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

In continuation of our exploration of using install-strategy=linked in the Gutenberg monorepo, which powers the WordPress Block Editor.

Under install-strategy=linked, npm exec -w <ws> -- <bin> ignored a workspace-local bin (provided by a sibling workspace dependency) and fell through to the registry, producing a spurious E404. The hoisted strategy ran the local bin correctly.

Why

For a workspace exec, the command computed the local bin directory as resolve(this.npm.localDir, name, 'node_modules', '.bin'), i.e. <root>/node_modules/<name>/node_modules/.bin. That path only resolves when the workspace is symlinked into the root node_modules as <name>, which is how the hoisted strategy lays workspaces out. The linked strategy does not hoist workspaces into the root node_modules; the workspace's real bin lives at <workspace>/node_modules/.bin. libnpmexec walks up from the given bin directory looking for node_modules/.bin/<bin>, so starting from the nonexistent hoisted path never reached the workspace's actual bin and the lookup fell back to the registry.

How

Base the local bin directory on the workspace's own path (runPath) instead of the hoisted localDir/<name> location. This is correct under both strategies: linked finds the bin in the workspace's node_modules/.bin, and hoisted still finds the root-hoisted bin because the walk-up continues from the workspace directory to the root node_modules/.bin.

References

Fixes #9616

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@manzoorwanijk
manzoorwanijk force-pushed the fix/linked-exec-workspace-bin branch from 12ebf3a to 8f6667e Compare June 24, 2026 17:29
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review June 24, 2026 17:31
@manzoorwanijk
manzoorwanijk requested review from a team as code owners June 24, 2026 17:31
@manzoorwanijk
manzoorwanijk force-pushed the fix/linked-exec-workspace-bin branch 2 times, most recently from c4ab8a3 to 1a0596e Compare June 24, 2026 18:29
@manzoorwanijk

manzoorwanijk commented Jun 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

The coverage is broken in latest as well.

EDIT: Resolved by #9646

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manzoorwanijk
fix(exec): resolve workspace-local bin under linked install strategy
86c6fd5
@manzoorwanijk
manzoorwanijk force-pushed the fix/linked-exec-workspace-bin branch from 1a0596e to 86c6fd5 Compare June 24, 2026 18:54
@manzoorwanijk
manzoorwanijk marked this pull request as draft June 24, 2026 19:21
@manzoorwanijk
manzoorwanijk marked this pull request as ready for review June 24, 2026 19:21
@owlstronaut owlstronaut added the backport:v11 label Jun 24, 2026
owlstronaut
owlstronaut approved these changes Jun 24, 2026
View reviewed changes
@owlstronaut
owlstronaut merged commit d6fbb55 into npm:latest Jun 24, 2026
27 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
fix(exec): resolve workspace-local bin under the linked install strategy #9648
Merged
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9648

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manzoorwanijk
manzoorwanijk deleted the fix/linked-exec-workspace-bin branch June 24, 2026 19:48
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
chore: release 12.0.0-pre.2 #9594
Merged
owlstronaut pushed a commit that referenced this pull request Jun 24, 2026
@github-actions @manzoorwanijk
fix(exec): resolve workspace-local bin under the linked install strat…
ae64f88
…egy (#9648)

Backport of #9639 to `release/v11`.

Co-authored-by: Manzoor Wani <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
[feature/ui] Preliminary UI design HoweiAY/brainly_alarm_expo#1
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 14, 2026
Feat/w3ds OIDC bridge MetaState-Prototype-Project/prototype#1102
Closed
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@owlstronaut owlstronaut owlstronaut approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

backport:v11

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] install-strategy=linked: npm exec -w <ws> ignores a workspace-local bin and falls back to the registry

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@manzoorwanijk @owlstronaut
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.