fix(@angular/cli): decouple official Node.js support check from execution gate - #34144
Merged
Merged
Conversation
…tion gate The `isNodeVersionSupported` function strictly validates whether a Node.js runtime matches an officially supported LTS track (such as `^22.22.3`, `^24.15.0`, or `^26.0.0`). Non-LTS odd releases (Node 23, 25) and uncertified newer releases (Node 27, 28+) return `false`, ensuring that `ng version` accurately marks them as unsupported. The `isNodeVersionRunnable` function dynamically determines whether an unsupported runtime can safely execute the CLI by checking if the major is an odd release between the minimum and maximum supported versions or higher than the maximum supported LTS major. The `bin/ng.js` bootstrap script now warns and continues execution on runnable unsupported runtimes instead of hardcoding specific major versions or aborting execution with an exit code of 3.
clydin
marked this pull request as ready for review
September 22, 2026 16:35
There was a problem hiding this comment.
Code Review
This pull request refactors Node.js version checking in the Angular CLI by introducing a new isNodeVersionRunnable utility to allow newer unsupported majors and interim odd-numbered releases. It also updates existing helper functions to accept optional parameters for easier testing and adds comprehensive unit tests. The review feedback highlights potential TypeError crashes in isNodeVersionRunnable and isNodeVersionMinSupported if an empty array is passed as the supported versions, suggesting guards to safely handle empty arrays.
Member
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
The
isNodeVersionSupportedfunction strictly validates whether a Node.js runtime matches an officially supported LTS track (such as^22.22.3,^24.15.0, or^26.0.0). Non-LTS odd releases (Node 23, 25) and uncertified newer releases (Node 27, 28+) returnfalse, ensuring thatng versionaccurately marks them as unsupported.The
isNodeVersionRunnablefunction dynamically determines whether an unsupported runtime can safely execute the CLI by checking if the major is an odd release between the minimum and maximum supported versions or higher than the maximum supported LTS major.The
bin/ng.jsbootstrap script now warns and continues execution on runnable unsupported runtimes instead of hardcoding specific major versions or aborting execution with an exit code of 3.