Skip to content

chore(setup): install Node 22 LTS via unified setup_nodejs#466

Merged
DorianZheng merged 1 commit into
mainfrom
chore/setup-nodejs-22
May 2, 2026
Merged

chore(setup): install Node 22 LTS via unified setup_nodejs#466
DorianZheng merged 1 commit into
mainfrom
chore/setup-nodejs-22

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • `make setup` now installs Node 22 LTS instead of whatever the distro ships
  • Replaces three bespoke `install_nodejs` flows (macOS / Ubuntu / manylinux) with a shared `setup_nodejs` that mirrors the existing `setup_go` pattern
  • `check_nodejs` is now version-aware (returns 0/1/2 like `check_go`)

Why

The Node SDK's `@napi-rs/cli@3` transitively requires `@inquirer/core@11` (engines `>=20.12`). On Ubuntu 24.04, `apt-get install nodejs` lands Node 18 (EOL since 2025-04-30), so `make test` fails at the `napi build` step. The manylinux path was hardcoded to Node 20.18, which hit EOL on 2026-04-30.

What's installed where

Platform Path
macOS `brew install node@22 && brew link --force`
Ubuntu/Debian NodeSource `setup_22.x` + `apt-get install nodejs`
Other Linux (manylinux / RHEL-ish) `nodejs.org` tarball, pinned to v22.18.0
musllinux Unchanged (no Node install; for Python wheel builds only)

`SKIP_INSTALL_NODEJS=1` still works as an opt-out.

Known gaps (deferred)

  • `sdks/node/package.json` still declares `engines.node >= 18` and `.github/workflows/config.yml` still tests `[18, 20, 22]`. This change only fixes `make setup`; aligning the published support matrix is a separate conversation.
  • Per-installer hardening (checksums, signed-by keyrings, post-install version re-check) would need to be done consistently across Go / Rust / protoc / Node — out of scope here.

Test plan

  • `bash -n` syntax-check all four modified scripts
  • `make setup` on Ubuntu 24.04: Node 18 → Node 22 (boxlite-prod EC2)
  • Second `make setup` is a no-op (idempotent)
  • `SKIP_INSTALL_NODEJS=1 make setup` skips installation
  • `make test` succeeds on the upgraded box

Distro Node on Ubuntu 24.04 ships v18 (EOL 2025-04-30) and the manylinux
path was pinned to v20.18 (EOL 2026-04-30), so make setup produced a
Node that's too old for the SDK's transitive devDeps (@napi-rs/cli@3 ->
@inquirer/core@11 needs >=20.12).

Mirror the existing setup_go pattern: a shared check_nodejs that
validates the version, three platform installers (Homebrew node@22,
NodeSource setup_22.x, nodejs.org tarball), and a setup_nodejs
orchestrator. Per-env scripts now delegate to setup_nodejs.
@DorianZheng DorianZheng merged commit bfd0196 into main May 2, 2026
9 checks passed
@DorianZheng DorianZheng deleted the chore/setup-nodejs-22 branch May 2, 2026 13:56
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