Skip to content

fix(arborist): fix non-idempotent linked install with workspace projects#9094

Merged
wraithgar merged 1 commit intonpm:latestfrom
manzoorwanijk:fix/linked-strategy/idempotent-workspace-install
Mar 10, 2026
Merged

fix(arborist): fix non-idempotent linked install with workspace projects#9094
wraithgar merged 1 commit intonpm:latestfrom
manzoorwanijk:fix/linked-strategy/idempotent-workspace-install

Conversation

@manzoorwanijk
Copy link
Contributor

@manzoorwanijk manzoorwanijk commented Mar 10, 2026

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

Fix two issues in #buildLinkedActualForDiff() (introduced in #9031) that caused npm install --install-strategy=linked to always report changed N packages on subsequent runs for workspace projects with cross-workspace dependencies.

  1. The proxy used actual workspace children (with resolved: "file:../packages/...") but the ideal tree's workspace links had resolved: undefined, causing a false CHANGE.
  2. Actual fsChildren children (with resolved: "file:../../../node_modules/.store/...") overwrote synthetic store entries (with resolved: "file:.store/...") in allChildren().

The fix creates synthetic entries for all ideal children (not just store nodes) and uses empty fsChildren on the wrapper to prevent overwrites.

References

Fixes #9091

@manzoorwanijk manzoorwanijk requested a review from a team as a code owner March 10, 2026 15:20
@wraithgar wraithgar merged commit c7702d0 into npm:latest Mar 10, 2026
18 checks passed
@manzoorwanijk manzoorwanijk deleted the fix/linked-strategy/idempotent-workspace-install branch March 10, 2026 16:00
manzoorwanijk added a commit to manzoorwanijk/npm-cli that referenced this pull request Mar 10, 2026
wraithgar pushed a commit that referenced this pull request Mar 10, 2026
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.

[BUG] linked strategy: non-idempotent install with workspace projects

2 participants