From 67dc0edcbee947403f2d0847289e358e9f4ae048 Mon Sep 17 00:00:00 2001 From: hawkgs Date: Thu, 26 Feb 2026 17:21:53 +0200 Subject: [PATCH] fix(@angular/cli): reflect new minimum supported Node version in ng.js Update the minimum supported Node version to v22.22 and v24.13.1, respectively, in the CLI's binary script in order to reflect the changes introduced in `d0e9e81`. --- packages/angular/cli/bin/ng.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/angular/cli/bin/ng.js b/packages/angular/cli/bin/ng.js index e0f5eb36a2ef..8487b50a2ae1 100755 --- a/packages/angular/cli/bin/ng.js +++ b/packages/angular/cli/bin/ng.js @@ -42,7 +42,7 @@ if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completi // This node version check ensures that extremely old versions of node are not used. // These may not support ES2015 features such as const/let/async/await/etc. // These would then crash with a hard to diagnose error message. -const [major, minor] = process.versions.node.split('.', 2).map((part) => Number(part)); +const [major, minor, patch] = process.versions.node.split('.', 3).map((part) => Number(part)); if (major % 2 === 1) { // Allow new odd numbered releases with a warning (currently v17+) @@ -55,13 +55,17 @@ if (major % 2 === 1) { ); require('./bootstrap'); -} else if (major < 20 || (major === 20 && minor < 19) || (major === 22 && minor < 12)) { - // Error and exit if less than 20.19 or 22.12 +} else if ( + major < 22 || + (major === 22 && minor < 22) || + (major === 24 && minor < 13 && patch < 1) +) { + // Error and exit if less than 22.22 or 24.13.1 console.error( 'Node.js version ' + process.version + ' detected.\n' + - 'The Angular CLI requires a minimum Node.js version of v20.19 or v22.12.\n\n' + + 'The Angular CLI requires a minimum Node.js version of v22.22 or v24.13.1.\n\n' + 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n', );