Skip to content

feat(cli): add runtime Node.js version check with clear error message#11

Open
lxcario wants to merge 1 commit into
TestSprite:mainfrom
lxcario:feat/node-version-guard
Open

feat(cli): add runtime Node.js version check with clear error message#11
lxcario wants to merge 1 commit into
TestSprite:mainfrom
lxcario:feat/node-version-guard

Conversation

@lxcario

@lxcario lxcario commented Jun 23, 2026

Copy link
Copy Markdown

When run on Node < 20, the CLI crashes with cryptic ESM/syntax errors. This PR adds a top-of-file version guard in src/index.ts that checks process.versions.node and exits with a clear, helpful message if the major version is below 20.

Changes

  • Added version guard at the top of src/index.ts (before any imports that use modern syntax)
  • Exits with a clear error message pointing users to https://nodejs.org
  • Added src/version-guard.test.ts with 8 tests verifying the guard logic

Testing

  • npm run typecheck - clean
  • npm run lint:fix - clean
  • npx vitest run src/version-guard.test.ts - 8/8 passing

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