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 3131}
3232
3333const rawCommandName = process . argv [ 2 ] ;
34-
3534if ( rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion' ) {
3635 // Skip Node.js supported checks when running ng completion.
3736 // 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
4342// This node version check ensures that extremely old versions of node are not used.
4443// These may not support ES2015 features such as const/let/async/await/etc.
4544// 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 ) {
4848 // Allow new odd numbered releases with a warning (currently v17+)
4949 console . warn (
5050 'Node.js version ' +
@@ -55,13 +55,13 @@ if (version[0] % 2 === 1) {
5555 ) ;
5656
5757 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
6060 console . error (
6161 'Node.js version ' +
6262 process . version +
6363 ' 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' +
6565 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n' ,
6666 ) ;
6767
You can’t perform that action at this time.
0 commit comments