ci: unblock changesets publish from npm's devEngines check - #396
Merged
Conversation
`changeset publish` shells out to `npm info` to find out what is already
on the registry. npm >= 11 validates the root package.json's devEngines
on every command, so it errors with EBADDEVENGINES ("Invalid name
\"pnpm\" does not match \"npm\"") before the release can start.
Set npm_config_force on the changesets step, which downgrades that check
to a warning. Publishing itself is unaffected: changesets detects the
pnpm lockfile and uploads through `pnpm publish`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2UZcjV4P98WFjzfRfLQvx
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P2UZcjV4P98WFjzfRfLQvx
6 tasks
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.
Fixes the failing Release job in run 31467628286 (and the identical failure on the
Version Packages (#393)merge, run 31466790389).The failure
changeset publishshells out tonpm info <pkg> --jsonto work out which versions are already on the registry — changesets 2.x always uses npm for this, there is no pnpm code path. npm ≥ 11 validates the rootpackage.json'sdevEnginesinBaseCommand#checkDevEngines, i.e. on every command includinginfo, so it exits 1 withEBADDEVENGINESbecause we declaredevEngines.packageManager: pnpmand the process running is npm.This is why the publish only broke now: the Release job only runs the publish command once the
Version PackagesPR has been merged, and the last actual publish was on 2026-01-05. All packages on npm are currently behind the repo (react-native-node-api1.0.1 vs 1.1.0,cmake-rn0.6.3 vs 0.7.0,ferric-cli0.3.11 vs 0.4.0, …), so releases are blocked until this lands.The fix
Set
npm_config_force: trueon the changesets step. npm'scheckDevEnginesdowngradesdevEngineserrors to warnings whenforceis set, which is the only supported escape hatch —--ignore-dev-enginesis not a thing in npm 11 (it warnsUnknown cli config "--ignore-dev-engines"and still errors).Verified locally against the repo root with Node 24 / npm 11.17:
Deliberately scoped to that one step rather than the workflow (so
pnpm installabove is untouched) and rather than relaxingdevEnginesinpackage.json(which would weaken the guard for everyone locally). Publishing itself is not affected byforce: changesets detects the pnpm lockfile and uploads viapnpm publish, andpnpm publishignores the npmforceconfig.Why not upgrade changesets instead
Changesets v3 does fix the root cause properly — its publish pipeline is package-manager-aware and runs
pnpm info/pnpm pack/pnpm publishwhen pnpm is detected, so npm is never invoked. But it isn't reachable yet:@changesets/cliv3 exists only as a prerelease (next=3.0.0-next.12);latestis still 2.31.1, whose shipped dist spawns barenpm info.New tag: <pkg>@<version>stdout line thatchangesets/action@v1parses; the action's v2 line instead has the CLI write NDJSONgit-tagevents to$CHANGESETS_OUTPUTand reads that file. CLI v3 with action v1 would publish but reportpublished: falseand push no git tags or GitHub releases — a silent regression rather than a loud one.changesets/actionv2 is prerelease-only too (v2.0.0-next.4, latest stablev1.9.0) and renames every input to kebab-case, so this step would becomepublish-script:plus agithub-token:input.So that migration is two coordinated prerelease majors on the release pipeline itself, and it's worth its own PR. The workflow comment records it as the removal condition for this workaround.
Heads-up, not addressed here
NPM_TOKENwas dropped from this step in 3690bd1 ("Update release to use themainenvironment") and nothing has been published since 2026-01-05, so the auth side of the publish is untested. If npm trusted publishing is not set up for these packages, the next failure will be an auth error and the step will need eitherNPM_TOKENmapped back in from themainenvironment orpermissions: id-token: writeon the job. I left that alone since I can't see the environment's secrets or the npm-side configuration — let me know which it should be and I'll follow up.