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
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
Member Author

~/D/s/doc-kit $ node /Users/gar/Development/npm/cli/branches/gar_optional-ci ci

added 634 packages, and audited 642 packages in 9s

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
~/D/s/doc-kit $ npm ci
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @unrs/resolver-binding-android-arm-eabi@1.9.2: wanted {"os":"android","cpu":"arm"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os:   android
npm error notsup Actual os:  darwin
npm error notsup Valid cpu:  arm
npm error notsup Actual cpu: arm64
npm error A complete log of this run can be found in: /Users/gar/.npm/_logs/2026-03-09T16_44_04_539Z-debug-0.log

@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