File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 31
31
}
32
32
33
33
const rawCommandName = process . argv [ 2 ] ;
34
-
35
34
if ( rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion' ) {
36
35
// Skip Node.js supported checks when running ng completion.
37
36
// A warning at this stage could cause a broken source action (`source <(ng completion script)`) when in the shell init script.
@@ -43,8 +42,9 @@ if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completi
43
42
// This node version check ensures that extremely old versions of node are not used.
44
43
// These may not support ES2015 features such as const/let/async/await/etc.
45
44
// These would then crash with a hard to diagnose error message.
46
- var version = process . versions . node . split ( '.' ) . map ( ( part ) => Number ( part ) ) ;
47
- if ( version [ 0 ] % 2 === 1 ) {
45
+ const [ major , minor ] = process . versions . node . split ( '.' , 2 ) . map ( ( part ) => Number ( part ) ) ;
46
+
47
+ if ( major % 2 === 1 ) {
48
48
// Allow new odd numbered releases with a warning (currently v17+)
49
49
console . warn (
50
50
'Node.js version ' +
@@ -55,13 +55,13 @@ if (version[0] % 2 === 1) {
55
55
) ;
56
56
57
57
require ( './bootstrap' ) ;
58
- } else if ( version [ 0 ] < 20 || ( version [ 0 ] === 20 && version [ 1 ] < 11 ) ) {
59
- // Error and exit if less than 20.11
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
60
60
console . error (
61
61
'Node.js version ' +
62
62
process . version +
63
63
' detected.\n' +
64
- 'The Angular CLI requires a minimum Node.js version of v20.11 .\n\n' +
64
+ 'The Angular CLI requires a minimum Node.js version of v20.19 or v22.12 .\n\n' +
65
65
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n' ,
66
66
) ;
67
67
You can’t perform that action at this time.
0 commit comments