Skip to content

fix(cli): require Node.js >=20 and surface a clear error on older runtimes#438

Merged
tannerlinsley merged 1 commit intomainfrom
claude/fix-top-issue-mUNTo
Apr 27, 2026
Merged

fix(cli): require Node.js >=20 and surface a clear error on older runtimes#438
tannerlinsley merged 1 commit intomainfrom
claude/fix-top-issue-mUNTo

Conversation

@tannerlinsley
Copy link
Copy Markdown
Member

@tannerlinsley tannerlinsley commented Apr 27, 2026

Older Node (e.g. 16) lacks events.addAbortListener, used transitively by
the CLI, which produced a cryptic SyntaxError at module instantiation.
Declare engines.node: ">=20" on both packages so installers warn, and add
an early runtime check in the bin so users get an actionable message
before any modules load.

Closes #433

https://claude.ai/code/session_01N5k5sqBgxYX9XMatM6TGcE

Summary by CodeRabbit

  • Chores
    • Updated minimum Node.js version requirement to 20 across CLI packages. Implemented an early runtime validation check that detects unsupported Node versions and displays a clear, actionable error message. This prevents cryptic module instantiation errors that previously occurred when running tools on incompatible Node runtime environments or older Node versions.

…times

Older Node (e.g. 16) lacks events.addAbortListener, used transitively by
the CLI, which produced a cryptic SyntaxError at module instantiation.
Declare engines.node: ">=20" on both packages so installers warn, and add
an early runtime check in the bin so users get an actionable message
before any modules load.

Closes #433

https://claude.ai/code/session_01N5k5sqBgxYX9XMatM6TGcE
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5093131e-508e-406e-a709-4afc28b6139c

📥 Commits

Reviewing files that changed from the base of the PR and between ff84201 and 22bd944.

📒 Files selected for processing (4)
  • .changeset/cli-require-node-20.md
  • packages/cli/package.json
  • packages/cli/src/bin.ts
  • packages/create/package.json

📝 Walkthrough

Walkthrough

This PR enforces Node.js 20+ as a minimum runtime requirement for @tanstack/cli and @tanstack/create packages by declaring engine constraints in package manifests and implementing an early CLI runtime check that terminates with an actionable error message on unsupported Node versions, preventing cryptic module instantiation failures.

Changes

Cohort / File(s) Summary
Release Note
.changeset/cli-require-node-20.md
New changeset documenting patch-level release for both packages enforcing Node.js >=20 requirement and adding runtime validation logic.
Package Engine Constraints
packages/cli/package.json, packages/create/package.json
Both package manifests updated to declare engines.node: ">=20" for npm ecosystem compliance.
CLI Entrypoint
packages/cli/src/bin.ts
Added runtime Node.js major version validation with early exit on versions <20; converted static ESM imports to top-level dynamic imports for cli and @tanstack/create modules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A Node version guard, so swift and so keen,
Ensures the runtime is twenty or green,
No more cryptic errors from Bun's weary call,
Just a clear message saying "upgrade them all!"
With dynamic imports and checks in place,
The CLI now runs with a wonderful grace! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-top-issue-mUNTo

Comment @coderabbitai help to get the list of available commands and usage tips.

@tannerlinsley tannerlinsley merged commit 0a8be74 into main Apr 27, 2026
3 of 4 checks passed
@tannerlinsley tannerlinsley deleted the claude/fix-top-issue-mUNTo branch April 27, 2026 04:05
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.

Quick Start example fails when using Bun

2 participants