Skip to content

Commit 3089ab4

Browse files
clydinAndrewKushnir
authored andcommitted
build: update minimum development Node.js versions (angular#60080)
With Node.js v18 approaching End-of-Life on 2025-04-30, the minimum supported versions for development have been updated to `^20.11.1 || ^22.11.0`. This change does not affect published packages. The custom ESM loader was disabled in several Node.js jasmine tests due to incompatibilities with the updated custom loader API in newer Node.js versions. The API in v18 was not considered stable. The rules_js migration will remove the need for this loader fully in future. PR Close angular#60080
1 parent 8fea532 commit 3089ab4

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.20.5
1+
20.11.1

WORKSPACE

+12-11
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,20 @@ http_archive(
4747
# Setup the Node.js toolchain.
4848
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
4949

50+
NODE_20_REPO = {
51+
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
52+
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
53+
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
54+
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
55+
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
56+
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
57+
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
58+
}
59+
5060
nodejs_register_toolchains(
5161
name = "nodejs",
52-
node_repositories = {
53-
"18.20.5-darwin_arm64": ("node-v18.20.5-darwin-arm64.tar.gz", "node-v18.20.5-darwin-arm64", "bdfeaf59dbf29aec08c0c66130edf0a8a17014b4f2997727641dfd0b58b51f48"),
54-
"18.20.5-darwin_amd64": ("node-v18.20.5-darwin-x64.tar.gz", "node-v18.20.5-darwin-x64", "dff01068da7d3fe7b515f72a3903dca96a34dc377f6f426b6a813901274b6441"),
55-
"18.20.5-linux_arm64": ("node-v18.20.5-linux-arm64.tar.xz", "node-v18.20.5-linux-arm64", "a77db6ab34267f3bc80e02ed68abf51b7065eb5c82fcd69adc4b40e390d9b116"),
56-
"18.20.5-linux_ppc64le": ("node-v18.20.5-linux-ppc64le.tar.xz", "node-v18.20.5-linux-ppc64le", "63b4c6801c96fb452e3bd8125e8b5b195ecacc4fa2505e47a128e94587999aeb"),
57-
"18.20.5-linux_s390x": ("node-v18.20.5-linux-s390x.tar.xz", "node-v18.20.5-linux-s390x", "617d7456e16534a4b4e03f5285cc8d13581f39cdad9196efff2516d6588de319"),
58-
"18.20.5-linux_amd64": ("node-v18.20.5-linux-x64.tar.xz", "node-v18.20.5-linux-x64", "e4a3a21e5ac7e074ed50d2533dd0087d8460647ab567464867141a2b643f3fb3"),
59-
"18.20.5-windows_amd64": ("node-v18.20.5-win-x64.zip", "node-v18.20.5-win-x64", "910237449895b4de61026568dc076fa6c3ffcd667563ed03112a4a77e1f1556b"),
60-
},
61-
# We need at least Node 18.20.5 due to some transitive dependencies.
62-
node_version = "18.20.5",
62+
node_repositories = NODE_20_REPO,
63+
node_version = "20.11.1",
6364
)
6465

6566
# Download npm dependencies.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"bugs": "https://github.com/angular/angular/issues",
88
"license": "MIT",
99
"engines": {
10-
"node": "^18.19.1 || ^20.11.1",
10+
"node": "^20.11.1 || ^22.11.0",
1111
"yarn": ">=1.22.4 <2",
1212
"npm": "Please use yarn instead of NPM to install dependencies"
1313
},

packages/platform-server/init/test/shims_spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ describe('applyShims()', () => {
1515
// Un-patch `global`.
1616
const currentProps = Object.keys(global);
1717
for (const prop of currentProps) {
18+
if (prop === 'crypto') {
19+
// crypto is a getter and cannot be changed
20+
continue;
21+
}
1822
if (globalClone.hasOwnProperty(prop)) {
1923
(global as any)[prop] = (globalClone as any)[prop];
2024
} else {

0 commit comments

Comments
 (0)