Skip to content

Commit c29c8e1

Browse files
clydinangular-robot[bot]
authored andcommitted
refactor(@angular/cli): remove Node.js v14 support
BREAKING CHANGE: Node.js v14 support has been removed Node.js v14 is planned to be End-of-Life on 2023-04-30. Angular will stop supporting Node.js v14 in Angular v16. Angular v16 will continue to officially support Node.js versions v16 and v18.
1 parent a8968b6 commit c29c8e1

File tree

10 files changed

+23
-39
lines changed

10 files changed

+23
-39
lines changed

.circleci/dynamic_config.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ parameters:
2323
## IMPORTANT
2424
# Windows needs its own cache key because binaries in node_modules are different.
2525
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
26-
var_1: &cache_key v1-angular_devkit-14.20-{{ checksum "yarn.lock" }}
26+
var_1: &cache_key v1-angular_devkit-16.13-{{ checksum "yarn.lock" }}
2727
var_1_win: &cache_key_win v1-angular_devkit-win-16.13-{{ checksum "yarn.lock" }}
28-
var_3: &default_nodeversion '14.20'
29-
var_3_major: &default_nodeversion_major '14'
28+
var_3: &default_nodeversion '16.13'
29+
var_3_major: &default_nodeversion_major '16'
3030
# The major version of node toolchains. See tools/toolchain_info.bzl
3131
# NOTE: entries in this array may be repeated elsewhere in the file, find them before adding more
32-
var_3_all_major: &all_nodeversion_major ['14', '16', '18']
32+
var_3_all_major: &all_nodeversion_major ['16', '18']
3333
# Workspace initially persisted by the `setup` job, and then enhanced by `setup-and-build-win`.
3434
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
3535
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
@@ -236,7 +236,7 @@ jobs:
236236
equal: [*default_nodeversion_major, << parameters.nodeversion >>]
237237
steps:
238238
- run:
239-
command: yarn bazel test --test_tag_filters=-node16,-node18,-node<< parameters.nodeversion >>-broken //packages/...
239+
command: yarn bazel test --test_tag_filters=-node18,-node<< parameters.nodeversion >>-broken //packages/...
240240
# This timeout provides time for the actual tests to timeout and report status
241241
# instead of CircleCI stopping the job without test failure information.
242242
no_output_timeout: 40m
@@ -402,7 +402,7 @@ workflows:
402402
# Disable running this on Node.js 18 for now. This causes failures when using RBE.
403403
# Example: `GLIBC_2.28' not found.
404404
# Likely this is caused by outdated Ubuntu image https://github.com/angular/dev-infra/blob/main/bazel/remote-execution/BUILD.bazel#L21
405-
nodeversion: ['14', '16']
405+
nodeversion: ['16']
406406
requires:
407407
- build
408408

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.20.0
1+
18.10.0

WORKSPACE

+7-17
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ rules_pkg_dependencies()
5252
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
5353

5454
nodejs_register_toolchains(
55-
name = "nodejs",
56-
node_version = "14.20.0",
55+
name = "node16",
56+
node_version = "16.13.1",
57+
)
58+
59+
nodejs_register_toolchains(
60+
name = "node18",
61+
node_version = "18.10.0",
5762
)
5863

5964
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
@@ -89,21 +94,6 @@ aspect_bazel_lib_dependencies()
8994

9095
register_jq_toolchains(version = "1.6")
9196

92-
nodejs_register_toolchains(
93-
name = "node14",
94-
node_version = "14.20.0",
95-
)
96-
97-
nodejs_register_toolchains(
98-
name = "node16",
99-
node_version = "16.13.1",
100-
)
101-
102-
nodejs_register_toolchains(
103-
name = "node18",
104-
node_version = "18.10.0",
105-
)
106-
10797
register_toolchains(
10898
"@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain",
10999
"@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain",

constants.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Engine versions to stamp in a release package.json
2-
RELEASE_ENGINES_NODE = "^14.20.0 || ^16.13.0 || >=18.10.0"
2+
RELEASE_ENGINES_NODE = "^16.13.0 || >=18.10.0"
33
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
44
RELEASE_ENGINES_YARN = ">= 1.13.0"
55

lib/packages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function loadPackageJson(p: string) {
8585
// Overwrite engines to a common default.
8686
case 'engines':
8787
pkg['engines'] = {
88-
'node': '^14.20.0 || ^16.13.0 || >=18.10.0',
88+
'node': '^16.13.0 || >=18.10.0',
8989
'npm': '^6.11.0 || ^7.5.6 || >=8.0.0',
9090
'yarn': '>= 1.13.0',
9191
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"url": "https://github.com/angular/angular-cli.git"
4242
},
4343
"engines": {
44-
"node": "^14.20.0 || ^16.13.0 || ^18.10.0",
44+
"node": "^16.13.0 || ^18.10.0",
4545
"yarn": ">=1.21.1 <2",
4646
"npm": "Please use yarn instead of NPM to install dependencies"
4747
},

packages/angular/cli/lib/cli/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ import { writeErrorToLogFile } from '../../src/utilities/log-file';
1616

1717
export { VERSION } from '../../src/utilities/version';
1818

19-
const MIN_NODEJS_VERISON = [14, 15] as const;
19+
const MIN_NODEJS_VERSION = [16, 13] as const;
2020

2121
/* eslint-disable no-console */
2222
export default async function (options: { cliArgs: string[] }) {
2323
// This node version check ensures that the requirements of the project instance of the CLI are met
2424
const [major, minor] = process.versions.node.split('.').map((part) => Number(part));
2525
if (
26-
major < MIN_NODEJS_VERISON[0] ||
27-
(major === MIN_NODEJS_VERISON[0] && minor < MIN_NODEJS_VERISON[1])
26+
major < MIN_NODEJS_VERSION[0] ||
27+
(major === MIN_NODEJS_VERSION[0] && minor < MIN_NODEJS_VERSION[1])
2828
) {
2929
process.stderr.write(
3030
`Node.js version ${process.version} detected.\n` +
31-
`The Angular CLI requires a minimum of v${MIN_NODEJS_VERISON[0]}.${MIN_NODEJS_VERISON[1]}.\n\n` +
31+
`The Angular CLI requires a minimum of v${MIN_NODEJS_VERSION[0]}.${MIN_NODEJS_VERSION[1]}.\n\n` +
3232
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
3333
);
3434

packages/angular/cli/src/commands/version/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface PartialPackageInfo {
2222
/**
2323
* Major versions of Node.js that are officially supported by Angular.
2424
*/
25-
const SUPPORTED_NODE_MAJORS = [14, 16, 18];
25+
const SUPPORTED_NODE_MAJORS = [16, 18];
2626

2727
const PACKAGE_PATTERNS = [
2828
/^@angular\/.*/,

tools/test/expected_package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
},
3737
"engines": {
38-
"node": "^14.20.0 || ^16.13.0 || >=18.10.0",
38+
"node": "^16.13.0 || >=18.10.0",
3939
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
4040
"yarn": ">= 1.13.0"
4141
}

tools/toolchain_info.bzl

-6
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
# the name can be anything the user wants this is just added to the target to create unique names
44
# the order will match against the order in the TOOLCHAIN_VERSION list.
55
TOOLCHAINS_NAMES = [
6-
"node14",
76
"node16",
87
"node18",
98
]
109

1110
# this is the list of toolchains that should be used and are registered with nodejs_register_toolchains in the WORKSPACE file
1211
TOOLCHAINS_VERSIONS = [
13-
select({
14-
"@bazel_tools//src/conditions:linux_x86_64": "@node14_linux_amd64//:node_toolchain",
15-
"@bazel_tools//src/conditions:darwin": "@node14_darwin_amd64//:node_toolchain",
16-
"@bazel_tools//src/conditions:windows": "@node14_windows_amd64//:node_toolchain",
17-
}),
1812
select({
1913
"@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain",
2014
"@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain",

0 commit comments

Comments
 (0)