Skip to content

Commit af2300d

Browse files
yosriadyclaude
andauthored
fix(ci): unpin Node/npm engine mismatch breaking publish (#57)
`npm install -g npm@latest` began resolving to npm 12.0.1, whose engines require Node ^22.22.2 || ^24.15.0 || >=26.0.0. The release workflow pins Node 22.14.0, so the step failed with EBADENGINE and the v1.0.0 publish never ran. Nothing in the repo changed -- npm 12 shipped and moved the floor under a floating dist-tag. Bump Node to 22.23.1 (current v22 LTS patch, satisfies ^22.22.2) and pin npm to the major (npm@12) so the next npm major cannot silently break releases again. The step exists only because Node 22 bundles npm 10.9.x, which predates the OIDC trusted publishing support added in 11.5.1. Node is bumped in ci.yml too, since CI and release are deliberately kept on the same pin and drift between them is its own hazard. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 61e35cb commit af2300d

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Node
2828
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
2929
with:
30-
node-version: "22.14.0"
30+
node-version: "22.23.1"
3131
cache: 'pnpm'
3232

3333
- name: Install dependencies
@@ -56,7 +56,7 @@ jobs:
5656
- name: Setup Node
5757
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
5858
with:
59-
node-version: "22.14.0"
59+
node-version: "22.23.1"
6060
cache: 'pnpm'
6161

6262
- name: Install dependencies
@@ -79,7 +79,7 @@ jobs:
7979
- name: Setup Node
8080
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
8181
with:
82-
node-version: "22.14.0"
82+
node-version: "22.23.1"
8383
cache: 'pnpm'
8484

8585
- name: Install dependencies
@@ -105,7 +105,7 @@ jobs:
105105
- name: Setup Node
106106
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
107107
with:
108-
node-version: "22.14.0"
108+
node-version: "22.23.1"
109109
cache: 'pnpm'
110110

111111
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ jobs:
4040
- name: Setup Node
4141
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
4242
with:
43-
node-version: "22.14.0"
43+
node-version: "22.23.1"
4444
# No registry-url - using OIDC trusted publishing instead
4545
# No cache - mitigates cache-poisoning risk in publish workflow
4646

4747
- name: Update npm for trusted publishing
48-
run: npm install -g npm@latest
48+
# Pin the major: each npm major raises its minimum Node version, so
49+
# `npm@latest` silently breaks this job whenever a new major lands
50+
# (npm 12 requires Node ^22.22.2). Bump this alongside node-version.
51+
run: npm install -g npm@12
4952

5053
- name: Install dependencies
5154
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)