ci: pin npm 11 to unblock Dependabot frontend PRs#271
Merged
Conversation
CI installs Node 22 which ships npm 10.9.7. That version's `npm ci` strictly requires the nested `chokidar@4.0.3` / `readdirp@4.1.2` entries that `@angular-devkit/*` packages declare as optional peer deps. Dependabot regenerates `package-lock.json` with a newer npm that prunes those entries, producing lockfiles npm 10.9.7 rejects with EUSAGE — blocking #248, #250, #256, #261, #262. Aligning CI to npm 11 matches Dependabot's resolution so the post-rebase lockfile is accepted.
There was a problem hiding this comment.
Pull request overview
This PR updates the CI pipeline to align the frontend job’s npm version with the lockfiles Dependabot generates, preventing npm ci failures on Dependabot-managed frontend dependency PRs.
Changes:
- Add a CI step in the frontend job to install npm 11 before running
npm ci. - Document the CI/root-cause and fix in the Unreleased changelog.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
CHANGELOG.md |
Adds an Unreleased “Fixed” entry describing the Dependabot/lockfile npm ci failure and the CI mitigation. |
.github/workflows/ci.yml |
Installs npm 11 in the frontend job prior to dependency installation to match Dependabot lockfile behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+70
to
+71
| - name: Pin npm 11 | ||
| run: npm install -g npm@11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CI failures on 5 open Dependabot frontend PRs (#248, #250, #256, #261, #262).
Root cause
node-version: '22'→ bundled npm 10.9.7.@angular-devkit/architectand 3 sibling packages declarechokidaras an optional peer (^4.0.0). When the lockfile is generated, nested entries are written forchokidar@4.0.3andreaddirp@4.1.2under those packages.package-lock.jsonwith a newer npm (11.x) that prunes those nested optional-peer entries.npm cistrictly requires the entries to be present, fails withEUSAGE: Missing: chokidar@4.0.3 from lock file.Reproduction:
npm ciagainst any of the 5 PR head SHAs with npm 10.9.7 fails; the same checkout with npm 11.x succeeds.Fix
Add a
Pin npm 11step in thefrontendjob that runsnpm install -g npm@11betweensetup-nodeandnpm ci. This aligns CI's install resolution with Dependabot's so lockfiles produced by Dependabot are accepted.Follow-up after merge
@dependabot rebaseon PRs deps: bump the eslint group across 1 directory with 5 updates #248, deps: bump the angular group across 1 directory with 13 updates #250, deps: bump jsdom from 28.1.0 to 29.1.1 in /Applications/Pgan.PoracleWebNet.App/ClientApp #256, deps: bump the jest group across 1 directory with 3 updates #261, deps: bump @jest/globals from 30.3.0 to 30.4.1 in /Applications/Pgan.PoracleWebNet.App/ClientApp #262 to re-run their CI on top of the fix.Test plan
@dependabot rebaseon deps: bump the eslint group across 1 directory with 5 updates #248 and confirm Frontend (Angular) goes green