Skip to content

Unpin npm in release workflow once changesets supports npm 12 #52

Description

@joshuabaker

Context

The Release workflow broke on 2026-07-14 (first run after npm 12 became latest): every push to main failed with EPUBLISHCONFLICT while trying to republish the already-published authkit-react-native@0.1.3. Fixed in #51 by pinning the workflow to npm@11.

Root cause

npm 12.0.0 (released 2026-07-08) changed npm view/info --json to output an array of objects instead of a single object:

# npm 11
npm info authkit-react-native --json  →  { "versions": [...], ... }

# npm 12
npm info authkit-react-native --json  →  [ { "versions": [...], ... } ]

@changesets/cli (2.31.0, current latest stable) reads pkgInfo.versions from that output in getUnpublishedPackages to decide whether the local version is already on npm. With the array, versions is undefined, so every package looks unpublished and changeset publish attempts to republish existing versions. The registry rejects with EPUBLISHCONFLICT, and changesets' graceful already-published fallback doesn't trigger because it matches on error code E403 while the error arrives with no code.

What to do

When @changesets/cli ships a release that handles npm 12's --json output:

  1. Update @changesets/cli in devDependencies.
  2. Restore npm install -g npm@latest (or npm@12) in .github/workflows/release.yml, removing the pin comment.
  3. Verify a push to main with nothing to publish logs "is not being published because version X is already published on npm" instead of attempting a publish.

Note: the npm 12 requirement floor for trusted publishing is >= 11.5.1, so the npm@11 pin remains fully functional in the meantime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions