Skip to content

Commit d1f6169

Browse files
committed
build: set minimum Node.js version to 12.13
This change provides an improved performance baseline as well as access to newer Node.js APIs and Javascript language features which the Angular CLI will now be able to leverage. BREAKING CHANGE: Node.js version 10 will become EOL on 2021-04-30. Angular CLI 12 will require Node.js 12.13+ or 14.15+. Node.js 12.13 and 14.15 are the first LTS releases for their respective majors.
1 parent e00f6c9 commit d1f6169

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ commands:
7777
at: *workspace_location
7878
setup_windows:
7979
steps:
80-
- run: nvm install 12.1.0
81-
- run: nvm use 12.1.0
82-
- run: npm install -g yarn@1.17.3
80+
- run: nvm install 12.13
81+
- run: nvm use 12.13
82+
- run: npm install -g yarn@1.22.10
8383
- run: node --version
8484
- run: yarn --version
8585

lib/packages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function loadPackageJson(p: string) {
8787
// Overwrite engines to a common default.
8888
case 'engines':
8989
pkg['engines'] = {
90-
'node': '>= 10.13.0',
90+
'node': '>= 12.13.0',
9191
'npm': '^6.11.0',
9292
'yarn': '>= 1.13.0',
9393
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"url": "https://github.com/angular/angular-cli.git"
4444
},
4545
"engines": {
46-
"node": ">=10.13.0 <13.0.0",
46+
"node": ">=12.13.0 <15.0.0",
4747
"yarn": ">=1.22.4"
4848
},
4949
"author": "Angular Authors",

packages/angular/cli/bin/ng

+21-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,28 @@ try {
1414
// These may not support ES2015 features such as const/let/async/await/etc.
1515
// These would then crash with a hard to diagnose error message.
1616
// tslint:disable-next-line: no-var-keyword
17-
var version = process.versions.node.split('.').map(part => Number(part));
18-
if (version[0] < 10 || version[0] === 11 || (version[0] === 10 && version[1] < 13)) {
17+
var version = process.versions.node.split('.').map((part) => Number(part));
18+
if (version[0] % 2 === 1 && version[0] > 14) {
19+
// Allow new odd numbered releases with a warning (currently v15+)
20+
console.warn(
21+
'Node.js version ' +
22+
process.version +
23+
' detected.\n' +
24+
'Odd numbered Node.js versions will not enter LTS status and should not be used for production.' +
25+
' For more information, please see https://nodejs.org/en/about/releases/.',
26+
);
27+
} else if (
28+
version[0] < 12 ||
29+
version[0] === 13 ||
30+
(version[0] === 12 && version[1] < 13) ||
31+
(version[0] === 14 && version[1] < 15)
32+
) {
1933
console.error(
20-
'Node.js version ' + process.version + ' detected.\n' +
21-
'The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.\n\n' +
22-
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n'
34+
'Node.js version ' +
35+
process.version +
36+
' detected.\n' +
37+
'The Angular CLI requires a minimum Node.js version of either v12.13 or v14.15.\n\n' +
38+
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
2339
);
2440

2541
process.exitCode = 3;

packages/angular_devkit/benchmark/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
"keywords": [
1010
"benchmark"
1111
],
12-
"engines": {
13-
"node": ">= 10.13.0",
14-
"npm": ">= 6.2.0"
15-
},
1612
"dependencies": {
1713
"@angular-devkit/core": "0.0.0",
1814
"ansi-colors": "4.1.1",

0 commit comments

Comments
 (0)