fix(ci): don't error on optional deps in the lockfile by wraithgar · Pull Request #9083 · npm/cli · GitHub
Skip to content

fix(ci): don't error on optional deps in the lockfile#9083

Merged
wraithgar merged 1 commit intolatestfrom
gar/optional-ci
Mar 9, 2026
Merged

fix(ci): don't error on optional deps in the lockfile#9083
wraithgar merged 1 commit intolatestfrom
gar/optional-ci

Conversation

@wraithgar
Copy link
Copy Markdown
Member

We build a virtual tree from the lockfile before we build the ideal tree so that we can compare the two and error if package.json differs from what was used to build the lockfile.

The virtual tree includes optional deps in it that would otherwise be ignored when building the ideal tree. In order not to have npm ci fail in this situation we need to build the virtual tree separately, and start clean when building the ideal tree.

This also brings in a few linting fixups.

We build a virtual tree from the lockfile before we build the ideal tree so that we can compare the two and error if package.json differs from what was used to build the lockfile.

The virtual tree includes optional deps in it that would otherwise be ignored when building the ideal tree.  In order not to have `npm ci` fail in this situation we need to build the virtual tree separately, and start clean when building the ideal tree.

This also brings in a few linting fixups.
@wraithgar wraithgar requested a review from a team as a code owner March 9, 2026 16:43
@wraithgar
Copy link
Copy Markdown
Member Author

@wraithgar wraithgar merged commit 76c76e5 into latest Mar 9, 2026
20 checks passed
@wraithgar wraithgar deleted the gar/optional-ci branch March 9, 2026 17:09
@github-actions github-actions Bot mentioned this pull request Mar 9, 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.

2 participants