Repository navigation
fix(@angular/cli): decouple official Node.js support check from execution gate - #34144
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.
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.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.