Skip to content

fix(cli): show friendly error when Node < 20 on startup#41

Open
blut-agent wants to merge 1 commit into
aitrace-dev:mainfrom
blut-agent:fix/node-version-check
Open

fix(cli): show friendly error when Node < 20 on startup#41
blut-agent wants to merge 1 commit into
aitrace-dev:mainfrom
blut-agent:fix/node-version-check

Conversation

@blut-agent
Copy link
Copy Markdown

Summary

Adds a Node.js version check at CLI startup. When the running Node.js version is below v20, the CLI prints a friendly error message with the detected version, required version, and a link to download Node.js — instead of crashing with a cryptic error.

Related

Closes #23

Testing

Added Vitest unit tests covering both paths:

  • Passes when Node major >= 20
  • Exits with code 1 when Node major < 20 (tested with v16, v18, v19)

Tests couldn't be run locally due to missing node_modules in the sandbox. The test file is at packages/cli/src/check-version.test.ts.

Changes

  • Added checkNodeVersion() function in packages/cli/src/index.ts
  • Called at the top of main() before any other logic
  • Added unit tests for both pass and fail paths

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.

Show friendly error when Node < 20 on startup

1 participant