Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e90c1b

Browse files
committed
fix(@angular/cli): remove Node.js v18 support
Node.js v18 will reach its End-of-Life on 2025年04月30日 and as a result will not be supported with the upcoming Angular v20. Node.js Release Schedule: https://github.com/nodejs/release#release-schedule BREAKING CHANGE: Node.js v18 is no longer supported with Angular. Before updating a project to Angular v20, the Node.js version must be at least 20.11.1. For the full list of supported Node.js versions, see https://angular.dev/reference/versions.
1 parent 4255779 commit 5e90c1b

File tree

18 files changed

+215
-149
lines changed

18 files changed

+215
-149
lines changed

‎.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-1406867100
55
modules/testing/builder/package.json=973445093
6-
package.json=1689924778
6+
package.json=-149318065
77
packages/angular/build/package.json=1250379839
88
packages/angular/cli/package.json=-1917515334
99
packages/angular/pwa/package.json=1108903917
@@ -17,6 +17,6 @@ packages/angular_devkit/schematics/package.json=673943597
1717
packages/angular_devkit/schematics_cli/package.json=-2026655035
1818
packages/ngtools/webpack/package.json=605871936
1919
packages/schematics/angular/package.json=251715148
20-
pnpm-lock.yaml=751686031
20+
pnpm-lock.yaml=610919784
2121
pnpm-workspace.yaml=-1056556036
22-
yarn.lock=1471859413
22+
yarn.lock=1260513060

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,10 @@ jobs:
7575
fail-fast: false
7676
matrix:
7777
os: [ubuntu-latest, windows-latest]
78-
node: [18, 20, 22]
78+
node: [20, 22]
7979
subset: [npm, esbuild]
8080
shard: [0, 1, 2, 3, 4, 5]
8181
exclude:
82-
# Skip Node.js v18 tests on Windows
83-
- os: windows-latest
84-
node: 18
8582
# Skip Node.js v20 tests on Windows
8683
- os: windows-latest
8784
node: 20
@@ -130,7 +127,7 @@ jobs:
130127
fail-fast: false
131128
matrix:
132129
os: [ubuntu-latest]
133-
node: [18]
130+
node: [22]
134131
subset: [npm, esbuild]
135132
shard: [0, 1, 2, 3, 4, 5]
136133
runs-on: ${{ matrix.os }}

‎.github/workflows/pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
fail-fast: false
173173
matrix:
174174
os: [ubuntu-latest]
175-
node: [18]
175+
node: [22]
176176
subset: [npm, esbuild]
177177
shard: [0, 1, 2, 3, 4, 5]
178178
runs-on: ${{ matrix.os }}

‎.nvmrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.19.1
1+
20.11.1

‎WORKSPACE‎

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
workspace(name = "angular_cli")
22

3-
DEFAULT_NODE_VERSION = "18.19.1"
3+
DEFAULT_NODE_VERSION = "20.11.1"
44

55
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
66
# Override toolchain for tar on windows.
@@ -67,43 +67,28 @@ rules_pkg_dependencies()
6767
# Setup the Node.js toolchain
6868
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
6969

70-
NODE_18_REPO = {
71-
"18.19.1-darwin_arm64": ("node-v18.19.1-darwin-arm64.tar.gz", "node-v18.19.1-darwin-arm64", "0c7249318868877032ed21cc0ed450015ee44b31b9b281955521cd3fc39fbfa3"),
72-
"18.19.1-darwin_amd64": ("node-v18.19.1-darwin-x64.tar.gz", "node-v18.19.1-darwin-x64", "ab67c52c0d215d6890197c951e1bd479b6140ab630212b96867395e21d813016"),
73-
"18.19.1-linux_arm64": ("node-v18.19.1-linux-arm64.tar.xz", "node-v18.19.1-linux-arm64", "228ad1eee660fba3f9fd2cccf02f05b8ebccc294d27f22c155d20b233a9d76b3"),
74-
"18.19.1-linux_ppc64le": ("node-v18.19.1-linux-ppc64le.tar.xz", "node-v18.19.1-linux-ppc64le", "2e5812b8fc00548e2e8ab9daa88ace13974c16b6ba5595a7a50c35f848f7d432"),
75-
"18.19.1-linux_s390x": ("node-v18.19.1-linux-s390x.tar.xz", "node-v18.19.1-linux-s390x", "15106acf4c9e3aca02416dd89fb5c71af77097042455a73f9caa064c1988ead5"),
76-
"18.19.1-linux_amd64": ("node-v18.19.1-linux-x64.tar.xz", "node-v18.19.1-linux-x64", "f35f24edd4415cd609a2ebc03be03ed2cfe211d7333d55c752d831754fb849f0"),
77-
"18.19.1-windows_amd64": ("node-v18.19.1-win-x64.zip", "node-v18.19.1-win-x64", "ff08f8fe253fba9274992d7052e9d9a70141342d7b36ddbd6e84cbe823e312c6"),
70+
NODE_20_REPO = {
71+
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
72+
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
73+
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
74+
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
75+
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
76+
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
77+
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
7878
}
7979

80-
nodejs_register_toolchains(
81-
name = "node18",
82-
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
83-
node_repositories = NODE_18_REPO,
84-
node_version = "18.19.1",
85-
)
86-
8780
# Set the default nodejs toolchain to the latest supported major version
8881
nodejs_register_toolchains(
8982
name = "nodejs",
9083
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
91-
node_repositories = NODE_18_REPO,
84+
node_repositories = NODE_20_REPO,
9285
node_version = DEFAULT_NODE_VERSION,
9386
)
9487

9588
nodejs_register_toolchains(
9689
name = "node20",
9790
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
98-
node_repositories = {
99-
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
100-
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
101-
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
102-
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
103-
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
104-
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
105-
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
106-
},
91+
node_repositories = NODE_20_REPO,
10792
node_version = "20.11.1",
10893
)
10994

@@ -125,7 +110,7 @@ nodejs_register_toolchains(
125110
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")
126111

127112
rules_js_register_toolchains(
128-
node_repositories = NODE_18_REPO,
113+
node_repositories = NODE_20_REPO,
129114
node_version = DEFAULT_NODE_VERSION,
130115
)
131116

‎constants.bzl‎

Lines changed: 1 addition & 1 deletion
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 = "^18.19.1 || ^20.11.1 || >=22.0.0"
2+
RELEASE_ENGINES_NODE = "^20.11.1 || >=22.0.0"
33
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
44
RELEASE_ENGINES_YARN = ">= 1.13.0"
55

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "https://github.com/angular/angular-cli.git"
3333
},
3434
"engines": {
35-
"node": "^18.19.1 || ^20.11.1 || >=22.0.0",
35+
"node": "^20.11.1 || >=22.0.0",
3636
"npm": "Please use yarn instead of NPM to install dependencies"
3737
},
3838
"author": "Angular Authors",
@@ -93,7 +93,7 @@
9393
"@types/less": "^3.0.3",
9494
"@types/loader-utils": "^2.0.0",
9595
"@types/lodash": "^4.17.0",
96-
"@types/node": "^18.13.0",
96+
"@types/node": "^20.17.19",
9797
"@types/npm-package-arg": "^6.1.0",
9898
"@types/pacote": "^11.1.3",
9999
"@types/picomatch": "^3.0.0",

‎packages/angular/cli/bin/ng.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ if (version[0] % 2 === 1) {
5555
);
5656

5757
require('./bootstrap');
58-
} else if (version[0] < 18 || (version[0] === 18 && version[1] < 19)) {
59-
// Error and exit if less than 18.19
58+
} else if (version[0] < 20 || (version[0] === 20 && version[1] < 11)) {
59+
// Error and exit if less than 20.11
6060
console.error(
6161
'Node.js version ' +
6262
process.version +
6363
' detected.\n' +
64-
'The Angular CLI requires a minimum Node.js version of v18.19.\n\n' +
64+
'The Angular CLI requires a minimum Node.js version of v20.11.\n\n' +
6565
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
6666
);
6767

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { writeErrorToLogFile } from '../../src/utilities/log-file';
1616

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

19-
const MIN_NODEJS_VERSION = [18,13] as const;
19+
const MIN_NODEJS_VERSION = [20,11] as const;
2020

2121
/* eslint-disable no-console */
2222
export default async function (options: { cliArgs: string[] }) {

‎packages/angular/cli/src/command-builder/command-runner.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
141141
.wrap(yargs.terminalWidth())
142142
.parseAsync();
143143

144-
return process.exitCode ?? 0;
144+
return +(process.exitCode ?? 0);
145145
}
146146

147147
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /