Skip to content

Commit d04edbb

Browse files
authored
fix(ci): pin npm to 11.x for OIDC publish; npm 12 rejects unknown flags (#47)
`npm@latest` from #45 resolved to 12.0.2, which flipped a breaking change: > unknown CLI flags, abbreviated flags, and single-hyphen multi-char > shorthands now throw instead of warning. `pnpm publish` (used by `changeset publish` in this pnpm workspace) calls `npm publish` under the hood and forwards the original argv verbatim, including `--no-git-checks` — a pnpm-only flag. npm 10 silently ignored it, npm 12 errors with `EUNKNOWNCONFIG - Unknown cli flag: --git-checks` and every scoped package publish fails. Pin to `npm@11` instead: it has OIDC trusted publishing (added in 11.5.1) and still tolerates unknown flags with a warning, which is exactly what the pnpm → npm publish handoff needs.
1 parent a71c440 commit d04edbb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ jobs:
5050

5151
- name: Install Dependencies
5252
run: |
53-
# npm >=11.5.1 is required for OIDC trusted publishing. Node 22 ships
54-
# with npm 10.x, so upgrade explicitly before `changeset publish` runs.
55-
npm i -g npm@latest
53+
# OIDC trusted publishing requires npm >=11.5.1; Node 22 ships with
54+
# npm 10.x. Pin to 11.x because npm 12 turned unknown CLI flags into
55+
# errors, which trips `pnpm publish` forwarding `--no-git-checks` to
56+
# `npm publish`.
57+
npm i -g npm@11
5658
npm i -g corepack@latest --force
5759
corepack enable
5860
pnpm install

0 commit comments

Comments
 (0)