Skip to content

fix(arborist): respect --omit flag in linked install strategy#9066

Merged
wraithgar merged 1 commit intonpm:latestfrom
manzoorwanijk:fix/omit-dev-ignored-linked-strategy
Mar 5, 2026
Merged

fix(arborist): respect --omit flag in linked install strategy#9066
wraithgar merged 1 commit intonpm:latestfrom
manzoorwanijk:fix/omit-dev-ignored-linked-strategy

Conversation

@manzoorwanijk
Copy link
Contributor

@manzoorwanijk manzoorwanijk commented Mar 5, 2026

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

Summary

npm install --omit=dev with install-strategy=linked silently installs all dependencies including devDependencies. The --omit flag has no effect because the isolated reifier's makeIdealGraph unconditionally traverses all edges without consulting the omit option.

The ideal tree nodes already have dev/optional/peer flags set by calcDepFlags, so the fix is to call shouldOmit() when traversing edges in makeIdealGraph to skip nodes that match the omit set.

References

Fixes #9065

@manzoorwanijk
Copy link
Contributor Author

@wraithgar any idea why CI didn't trigger here?

@wraithgar
Copy link
Member

@manzoorwanijk nope. Computer gremlins.

@wraithgar wraithgar closed this Mar 5, 2026
@wraithgar wraithgar reopened this Mar 5, 2026
@manzoorwanijk manzoorwanijk marked this pull request as draft March 5, 2026 17:12
@manzoorwanijk manzoorwanijk marked this pull request as ready for review March 5, 2026 17:12
@manzoorwanijk manzoorwanijk force-pushed the fix/omit-dev-ignored-linked-strategy branch from 279d743 to eb2163a Compare March 5, 2026 17:14
@wraithgar
Copy link
Member

wraithgar commented Mar 5, 2026

Looks like actions is having trouble this morning, if I had to guess. Don't worry about it, we wouldn't release till next week so there is no rush here.

ETA: no need to guess https://www.githubstatus.com/incidents/g5gnt5l5hf56

@manzoorwanijk
Copy link
Contributor Author

Seems to be fine now.

@wraithgar wraithgar merged commit a774fb7 into npm:latest Mar 5, 2026
16 checks passed
@manzoorwanijk manzoorwanijk deleted the fix/omit-dev-ignored-linked-strategy branch March 6, 2026 06:43
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] --omit=dev silently ignored with install-strategy=linked

2 participants