improvement: pin Node.js version via .node-version and engines field#1611
Open
trishtzy wants to merge 1 commit intoPortkey-AI:mainfrom
Open
improvement: pin Node.js version via .node-version and engines field#1611trishtzy wants to merge 1 commit intoPortkey-AI:mainfrom
trishtzy wants to merge 1 commit intoPortkey-AI:mainfrom
Conversation
Align local dev with the Node.js runtime already used in CI (.github/workflows/*.yml pin 20.x) and the Dockerfile (node:20-alpine), so new contributors using fnm/nvm/asdf/nodenv/mise pick up a compatible version automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align local dev and CI on a single Node.js version pinned in
.node-version, so contributors usingfnm/nvm/asdf/nodenv/misepick up a compatible runtime automatically and CI no longer driftsfrom the version contributors run locally. Matches the Node 20 runtime already used by the
Dockerfile(
node:20-alpine).Description: (required)
.node-version(20.20.2, the latest 20.x LTS patch at time of writing). Consumable bynvm,fnm,asdf-nodejs,nodenv, andmise. Uses a fullMAJOR.MINOR.PATCHso it resolvesout-of-the-box across all listed managers (
nodenvandasdf-nodejsdo not resolve partial versions bydefault — see Allow setting version by major version number only nodenv/nodenv#240 / Support x.x format version strings nodenv/nodenv#53).
"engines": { "node": ">=20.9.0" }topackage.jsonsonpm installsurfaces a warning onmismatch.
20.9.0is the first active-LTS release of the Node 20 line — same idiom as Next.js(
>=20.9.0) and Hono (>=16.9.0). The upper bound is intentionally left open; the Node 24 crashtracked in fix: Node.js v24 crash — 'Failed to find Response internal state key' #1604 is a dependency bug that should be fixed in
@hono/node-server, not papered over here..github/workflows/check_code_formatting.ymland.github/workflows/npm_publish.ymlto readnode-version-file: '.node-version'instead of hardcodingnode-version: '20.x', giving the repo asingle source of truth for Node across local dev and CI. Bumps
actions/setup-nodefromv2→v4andv3→v4respectively (required:node-version-filewas added inv3).docs/installation-deployments.mdunder the NodeJS Server section so newcontributors know where the version comes from.
Tests Run/Test cases added: (required)
.node-versionsatisfies theengines.noderange locally (20.20.2≥20.9.0).actions/setup-node@v4supportsnode-version-fileper upstreamdocs.
npm run format:check— passes onpackage.json(repo's format glob excludes.md/.node-version/.yml, so no Prettier impact there).Check Prettier Formattingruns green against the pinned version.
Type of Change: