Skip to content

docs(release): record why npm@latest is safe on the v2 line - #77

Merged
unional merged 1 commit into
mainfrom
fix/npm-latest-under-npm12
Nov 7, 2026
Merged

unional merged 1 commit into
mainfrom
fix/npm-latest-under-npm12

Conversation

@unional

@unional unional commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Comment-only change to pnpm-release-changeset-oidc.yml. It records why the step that runs npm install -g npm@latest is safe now that npm@latest is npm 12, so nobody pins npm 11 to fix a problem this line doesn't have.

Evidence

  • npm@latest is 12.2.1 (npm view npm dist-tags).
  • npm 12 wraps npm info <pkg> --json in an array ([ { ... } ]). pnpm 10, 11 and 12 info --json print a plain object.
  • @changesets/cli v2 always runs npm info and reads pkgInfo.versions. With the array, that is undefined, so CLI v2 republishes existing versions and fails with E403 (npm info --json array output in npm 12 breaks published-version detection in changeset publish changesets/changesets#2164).
  • @changesets/cli v3 (3.0.3, dist/getPublishPlan.mjs):
    • its npm client unwraps a one-element array (parseInfoResult);
    • in a pnpm repo it runs pnpm info instead, with the array-aware parser on pnpm ≤10.
  • I ran CLI 3's own getPublishTool().info() locally with npm 12.1.0, npm 12.2.1, pnpm 10.34.9, pnpm 11.28.10 and pnpm 12.16.1. In every case a published package reported published=true with its versions array, and a missing package reported published=false.
  • Production runs of callers that use this workflow @v2 with npm 12.2.1:
    • @repobuddy/storybook published 2.34.1 alongside its existing versions;
    • buddy-agent-harness published 1.0.0 today;
    • no-op runs report "No unpublished projects to publish". Under CLI v2 these are the runs that would fail with E403.
  • All 14 callers found by code search use pnpm-release-changeset-oidc.yml@v2 with @changesets/cli ^3 and pnpm 11 or 12. changesets/action v2 refuses CLI v2, so no CLI v2 caller can publish through this line.

Not changed

  • pnpm-release-changeset.yml and pnpm-release-semantic.yml don't install npm. They run on Node 26, whose bundled npm is also 12, and their CLI 3 pairing is the same.
  • The frozen v1 tag's pnpm-release-changeset-oidc.yml also runs npm install -g npm@latest, and v1 pairs with CLI v2, so that combination is broken under npm 12. No current caller uses @v1. Fixing it means moving a tag, which is out of scope for this PR.

🤖 Generated with Claude Code

npm 12 (now npm@latest, 12.2.1) wraps `npm info --json` in an array.
@changesets/cli v2 reads that as "nothing published" and republishes,
failing with E403 (changesets/changesets#2164). CLI v3 unwraps the
array, and in a pnpm repo uses `pnpm info`, so this workflow, which
changesets/action v2 restricts to CLI v3, is safe on npm 12.

Verified: callers have published through this workflow on npm 12.2.1
(@repobuddy/storybook@2.34.1, buddy-agent-harness@1.0.0), and no-op
runs report "No unpublished projects to publish" instead of E403.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: unional <homawong@gmail.com>
@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1f54b15

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

unional added a commit to unional/skills that referenced this pull request Nov 4, 2026
CLI 3.0.3+ unwraps npm 12's array-wrapped `npm info --json` and uses
`pnpm info` in pnpm repos (changesets/changesets#2276), so npm@latest is safe
on the v2 line; repobuddy @v2 has published on npm 12.2.1
(repobuddy/.github#77). Scope the pnpm TypeError to CLI 3.0.0-3.0.2
(changesets/changesets#2274). @v1 (action v1 + CLI 2, npm@latest) stays
broken; a CLI 2 repo pins npm 11 (>= 11.5.1) itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: unional <homawong@gmail.com>
@unional
unional merged commit 2c9ffdf into main Nov 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant