Skip to content

chore(node): pin runtime and types to the Node 24 LTS line - #27

Merged
chriskehayias merged 1 commit into
devfrom
chore/pin-node-24
Sep 13, 2026
Merged

chore(node): pin runtime and types to the Node 24 LTS line#27
chriskehayias merged 1 commit into
devfrom
chore/pin-node-24

Conversation

@chriskehayias

Copy link
Copy Markdown
Contributor

Pins the project to a single Node major so local, CI, and Vercel all run the same runtime.

Why

engines.node was a three-arm range (^22.22.2 || ^24.15.0 || >=26.0.0), which let every environment pick a different arm. Vercel only offers major versions — 24.x (its current default), 22.x, 20.x — and engines.node overrides the project's Build & Deployment setting, so the deployed runtime was effectively 24 while nothing else guaranteed it.

@types/node was at ^26.5.1, two majors ahead of what actually runs. Typings for APIs that don't exist in the deployed Node compile clean and fail at request time.

Changes

File Change
package.json engines.node^24.15.0; @types/node ^26.5.1^24.13.4
.nvmrc (new) 24
.github/workflows/test.yml node-version: 24node-version-file: .nvmrc — removes the second hardcoded copy
scripts/setup.ts REQUIRED_NODE_VERSION = 20REQUIRED_NODE_MAJOR/MINOR (24/15); getNodeVersion() returns { major, minor }. Now rejects any major other than 24, not just older ones — someone on 26 previously passed setup while deploying to 24.
CLAUDE.md Node bullet rewritten with the pin and the condition that releases it; @types/node 25+ row added to Current holds
README.md Prerequisite is now v24.15.0+ on the 24.x line, .nvmrc-driven

The 24.15 floor is jsdom 30's requirement (strictest dev dependency); every 24.x Vercel ships satisfies it.

Vercel coverage

engines.node: ^24.15.0 resolves to the latest 24.x on Vercel and overrides the dashboard setting, covering both builds and functions. There is no Node-version field in vercel.json, so no such file was added — engines is the correct and complete mechanism. See Supported Node.js versions.

Hold condition

Hold this pin until Vercel's default Node version moves forward. Then bump engines.node, .nvmrc, @types/node, and REQUIRED_NODE_MAJOR in scripts/setup.ts together.

Verification

  • npm install clean — 0 vulnerabilities
  • npm run test:run — 812 tests / 50 files pass
  • eslint . — clean
  • npm run setup:check[1/8] Node.js version... ✓ v24.18.0

⚠️ Pre-existing, unrelated: tsc --noEmit reports 18 type errors in MP provider test files (CommunicationInfo / MessageInfo / FileUploadParams shape mismatches). The count is identical before and after this change. Since CI gates tests only, npm run build is already broken on dev independently of this PR.

🤖 Generated with Claude Code

Vercel only offers major Node versions (24.x is its current default, then
22.x and 20.x), and `engines.node` overrides the project's Build &
Deployment setting. Pinning the range to a single major keeps local, CI,
and deployed runtimes identical instead of letting each pick a different
arm of a multi-range.

- engines.node: `^22.22.2 || ^24.15.0 || >=26.0.0` -> `^24.15.0`.
  The 24.15 floor is jsdom 30's, the strictest dev dependency; every 24.x
  Vercel ships satisfies it.
- @types/node: `^26.5.1` -> `^24.13.4`. Types must not lead the runtime —
  typings for APIs that do not exist in the deployed Node compile clean
  and fail at request time.
- Add `.nvmrc` (`24`) and point CI at it via `node-version-file`, so the
  CI version is no longer a second hardcoded copy.
- scripts/setup.ts: `REQUIRED_NODE_VERSION = 20` becomes
  REQUIRED_NODE_MAJOR/MINOR (24/15) and `getNodeVersion()` returns
  `{ major, minor }`. The check now rejects any major other than 24, not
  just older ones — a developer on 26 was previously passing setup while
  deploying to 24.
- Document the pin and the condition that releases it (Vercel moving its
  default forward) in CLAUDE.md, plus an `@types/node` 25+ row in
  Current holds; refresh the README prerequisite.

Verified: npm install clean (0 vulnerabilities), 812 tests / 50 files
pass, `eslint .` clean, `setup:check` reports Node v24.18.0.

Note: `tsc --noEmit` reports 18 pre-existing type errors in MP provider
test files. The count is identical before and after this change and is
unrelated to it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chriskehayias
chriskehayias merged commit eb9d792 into dev Sep 13, 2026
1 check passed
@chriskehayias
chriskehayias deleted the chore/pin-node-24 branch September 13, 2026 11:56
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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