Skip to content

fix(@angular/cli): decouple official Node.js support check from execution gate - #34144

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:fix/cli-node-version-supported
Sep 22, 2026
Merged

clydin merged 1 commit into
angular:mainfrom
clydin:fix/cli-node-version-supported

Conversation

@clydin

@clydin clydin commented Sep 22, 2026

Copy link
Copy Markdown
Member

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.

…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 clydin added the target: minor This PR is targeted for the next minor release label Sep 22, 2026

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@clydin
clydin marked this pull request as ready for review September 22, 2026 16:35

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/angular/cli/bin/version.js
Comment thread packages/angular/cli/src/utilities/node-version.ts
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Sep 22, 2026
@clydin
clydin merged commit f52fb53 into angular:main Sep 22, 2026
43 checks passed
@clydin

clydin commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

@clydin
clydin deleted the fix/cli-node-version-supported branch September 22, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants