Skip to content

Commit 731d322

Browse files
mikolalysenkoclaude
andcommitted
fix(ci): pin the npm wrapper lock refresh to npm@10 via npx
The release-readiness gate re-runs version-sync.sh and compares the regenerated npm/socket-patch/package-lock.json byte-for-byte, so the lock's canonical shape is defined by whatever npm regenerates it. npm 11 adds libc arrays that npm 10 omits, which is how the #233 refresh (made locally with npm 11) broke the gate under CI's npm 10 — and the same drift would recur in reverse the day the runner image jumps to npm 11. Pinning the refresh via npx makes the gate independent of both the runner default and the developer's local npm; bumping the pin now takes a deliberate commit that refreshes the lock alongside it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 640a0a5 commit 731d322

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/version-sync.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ node -e "
3838
# Refresh the npm wrapper lockfile so package-lock.json stays in sync with the
3939
# bumped package.json (own version, optionalDependencies). Uses --package-lock-only
4040
# so node_modules is untouched.
41+
#
42+
# The npm major is pinned: the lock's byte shape depends on it (npm >= 11 adds
43+
# `libc` arrays to platform-package entries that npm 10 omits), and
44+
# release-lint.sh compares the regenerated lock byte-for-byte against the
45+
# committed one on every PR. An unpinned npm makes that gate depend on
46+
# whichever npm the runner or developer happens to have. Bumping this pin
47+
# requires refreshing the committed lock in the same commit.
48+
NPM_LOCK_REFRESH_VERSION="10"
4149
(
4250
cd "$REPO_ROOT/npm/socket-patch"
43-
npm install --package-lock-only --ignore-scripts >/dev/null
51+
npx --yes "npm@$NPM_LOCK_REFRESH_VERSION" install --package-lock-only --ignore-scripts >/dev/null
4452
)
4553

4654
# Update all per-platform npm package versions

0 commit comments

Comments
 (0)