Skip to content

fix(arborist): check deps installed under unlinked workspaces when there is no lockfile - #10013

Open
mpelikan wants to merge 1 commit into
npm:latestfrom
mpelikan:fix-10011-unlinked-workspace-deps
Open

mpelikan wants to merge 1 commit into
npm:latestfrom
mpelikan:fix-10011-unlinked-workspace-deps

Conversation

@mpelikan

Copy link
Copy Markdown

With no lockfile and no root node_modules, a workspace has no Link yet, so the missing-edge walk in #initTree never reaches the packages already installed under it. Their missing dependencies are never queued, and npm install exits 0 with an incomplete tree and lockfile.

This makes the walk also descend from each workspace's edges when it visits the project root. It walks into what the workspace has installed rather than the workspace itself: queueing the workspace there, ahead of the root, bypasses the workspaces filter and changes hoisting (it breaks the filtered-reification tests in reify.js).

This overlaps #9985, which changes the same walk to follow workspace links. Neither depends on the other: #9985 covers the case where the link exists, this one the case where it does not. Whichever lands second needs a small rebase.

Checked locally on 7b50811:

Fixes #10011

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] Dependencies of packages under a workspace's node_modules are dropped when the root node_modules and lockfile are deleted

1 participant