Skip to content

Commit 67dc0ed

Browse files
committed
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`.
1 parent b639433 commit 67dc0ed

File tree

1 file changed

+8
-4
lines changed
  • packages/angular/cli/bin

1 file changed

+8
-4
lines changed

packages/angular/cli/bin/ng.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completi
4242
// This node version check ensures that extremely old versions of node are not used.
4343
// These may not support ES2015 features such as const/let/async/await/etc.
4444
// These would then crash with a hard to diagnose error message.
45-
const [major, minor] = process.versions.node.split('.', 2).map((part) => Number(part));
45+
const [major, minor, patch] = process.versions.node.split('.', 3).map((part) => Number(part));
4646

4747
if (major % 2 === 1) {
4848
// Allow new odd numbered releases with a warning (currently v17+)
@@ -55,13 +55,17 @@ if (major % 2 === 1) {
5555
);
5656

5757
require('./bootstrap');
58-
} else if (major < 20 || (major === 20 && minor < 19) || (major === 22 && minor < 12)) {
59-
// Error and exit if less than 20.19 or 22.12
58+
} else if (
59+
major < 22 ||
60+
(major === 22 && minor < 22) ||
61+
(major === 24 && minor < 13 && patch < 1)
62+
) {
63+
// Error and exit if less than 22.22 or 24.13.1
6064
console.error(
6165
'Node.js version ' +
6266
process.version +
6367
' detected.\n' +
64-
'The Angular CLI requires a minimum Node.js version of v20.19 or v22.12.\n\n' +
68+
'The Angular CLI requires a minimum Node.js version of v22.22 or v24.13.1.\n\n' +
6569
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
6670
);
6771

0 commit comments

Comments
 (0)