Skip to content

fix(ci): upgrade Node.js to v22 and use pnpm config for npm release - #651

Closed
Tamim Hasan (tamimlabs) wants to merge 5 commits into
swc-project:mainfrom
tamimlabs:main
Closed

fix(ci): upgrade Node.js to v22 and use pnpm config for npm release#651
Tamim Hasan (tamimlabs) wants to merge 5 commits into
swc-project:mainfrom
tamimlabs:main

Conversation

@tamimlabs

Copy link
Copy Markdown

Summary of Changes

This PR resolves the CI failure in the Publish npm workflow caused by Node engine incompatibilities and package manager authentication issues.

1. Node.js Engine Mismatch (EBADENGINE)

  • Issue: The workflow step npm install -g npm@latest was attempting to install npm@12.x, which strictly requires Node.js ^22.22.2, ^24.15.0, or >=26.0.0. The runner was configured with Node.js v20.x, leading to an EBADENGINE build failure.
  • Fix: Upgraded actions/setup-node@v4 to use node-version: 22.

2. Authentication Configuration (ENEEDAUTH)

  • Issue: pnpm publish was failing with ENEEDAUTH due to missing registry token scope resolution when invoking npm config set. pnpm uses its own configuration hierarchy and does not reliably inherit npm CLI authorization flags.
  • Fix: Replaced npm config set with pnpm config set //registry.npmjs.org/:_authToken to ensure pnpm correctly recognizes the NPM_TOKEN secret during workspace publication.

Testing

  • Verified workflow execution on a personal fork.
  • Verified that Node.js 22 satisfies the engine requirements for npm@latest.

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 85a373c

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@CLAassistant

CLAassistant commented Aug 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Donny/강동윤 (kdy1) pushed a commit that referenced this pull request Aug 12, 2026
Fixes #650.

`npm install -g npm@latest` now resolves npm 12, which requires Node
`^22.22.2 || ^24.15.0 || >=26.0.0`. The workflow pins Node 20, so the
step fails before `pnpm publish` runs:

```
npm error notsup Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v20.20.2"}
```

Every publish since 2026-07-13 failed this way (runs 296–299), so
`swc_core` v73–v76 never reached npm.

Node 24 bundles npm 11.17.0, already above the 11.5.1 floor trusted
publishing needs, so the step is removed rather than re-pinned — that
drops `npm@latest` as a recurring break. Node 20 is also deprecated on
GHA runners.

Not covered here: the four missed versions (`@swc/plugin-styled-jsx`
13.16.0–13.19.0 and siblings) still need publishing. Re-running the
failed runs replays the Node 20 workflow, and the `publish` environment
is restricted to `main`, so that needs a maintainer decision.

Overlaps with #651, which fixes the same root cause via Node 22; that
one keeps the `npm@latest` step and adds `NPM_TOKEN` auth, which would
sidestep the OIDC trusted publishing added in #528.
@kdy1

Copy link
Copy Markdown
Member

Thanks, but closing in favor of #652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants