Repository navigation
Warn when the CLI runs on an unsupported Node.js version - #88
Closed
hamzahskafi wants to merge 1 commit into
Closed
hamzahskafi wants to merge 1 commit into
hamzahskafi wants to merge 1 commit into
Conversation
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
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.
Before: on Node.js 20, npm prints an
EBADENGINEwarning that is easy to miss duringnpx, 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:
This is a warning, not a hard stop. On Node.js 20.19.0,
--versionanddemoboth exit 0 today, so blocking those users would break something that works.How:
src/system/node-support.tscomparesprocess.versions.nodewith the 22.12 floor. A test keeps that floor equal toengines.nodeinpackage.json. The warning runs only in the direct-invocation path insrc/index.ts, so library imports and stdout, including--jsonoutput, are unchanged. There's also a CHANGELOG line under Unreleased.Checked:
tsc --noEmit, the new unit test, and the builtdist/index.json Node 20.19.0 (warning printed, exit 0) and on Node 22 (no warning). I did not run the fullnpm run checklocally; CI runs it.🤖 Generated with Claude Code
https://claude.ai/code/session_01GDyUamKnmW15VzoFLkwnX5
Generated by Claude Code