Skip to content

Warn when the CLI runs on an unsupported Node.js version - #88

Closed
hamzahskafi wants to merge 1 commit into
mainfrom
claude/cli-node-eol-warning
Closed

hamzahskafi wants to merge 1 commit into
mainfrom
claude/cli-node-eol-warning

Conversation

@hamzahskafi

Copy link
Copy Markdown
Contributor

Before: on Node.js 20, npm prints an EBADENGINE warning that is easy to miss during npx, and then the CLI runs with no sign that the version is unsupported. Node.js 20 reached end of life in April 2026.

After: when the CLI runs directly on Node.js older than 22.12, it prints one stderr line first and then runs the command as before:

Warning: AugmentWorks supports Node.js 22.12 or newer, and this is Node.js v20.19.0. Upgrade to the current LTS release: https://nodejs.org/en/download

This is a warning, not a hard stop. On Node.js 20.19.0, --version and demo both exit 0 today, so blocking those users would break something that works.

How: src/system/node-support.ts compares process.versions.node with the 22.12 floor. A test keeps that floor equal to engines.node in package.json. The warning runs only in the direct-invocation path in src/index.ts, so library imports and stdout, including --json output, are unchanged. There's also a CHANGELOG line under Unreleased.

Checked: tsc --noEmit, the new unit test, and the built dist/index.js on Node 20.19.0 (warning printed, exit 0) and on Node 22 (no warning). I did not run the full npm run check locally; CI runs it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDyUamKnmW15VzoFLkwnX5


Generated by Claude Code

0.4.0 declares engines.node >=22.12, but the CLI still runs on Node.js 20
(checked: --version and demo exit 0 on 20.19.0). Print one stderr line
with the supported floor and the nodejs.org download link when the CLI
is run directly on an older release, then carry on. Library imports and
stdout (including --json) are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDyUamKnmW15VzoFLkwnX5
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