Repository: compiler-explorer/compiler-explorer
Pull request #7343 (2025-01-30 18:27:22)

Upgrade to node 20 minimum, target node 22


Patch:
diff --git a/.github/workflows/deploy-win.yml b/.github/workflows/deploy-win.yml
index ece5fdbee..fca7c444d 100644
--- a/.github/workflows/deploy-win.yml
+++ b/.github/workflows/deploy-win.yml
@@ -22,10 +22,10 @@ jobs:
         with:
           fetch-depth: 0
           ref: ${{ github.event.inputs.buildnumber }}
-      - name: Use Node.js 20.12.1
+      - name: Use Node.js 22.13.1
         uses: actions/setup-node@v4
         with:
-          node-version: 20.12.1
+          node-version: 22.13.1
           cache: npm
       - name: Build distribution
         id: build_dist
@@ -44,10 +44,10 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      - name: Use Node.js 20.x
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.x
+          node-version: 22.x
           check-latest: true
           cache: npm
       - name: Download the built distribution
diff --git a/README.md b/README.md
index 1c02e9270..2d4413a60 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ Assuming you have a compatible version of `node` installed, on Linux simply runn
 running with an Explorer running on port 10240 on your local machine:
 [http://localhost:10240/](http://localhost:10240/). If this doesn't work for you, please contact us, as we consider it
 important you can quickly and easily get running. Currently, **Compiler Explorer** requires
-[`node` 20](CONTRIBUTING.md#node-version) installed, either on the path or at `NODE_DIR` (an environment variable or
+[`node` 22](CONTRIBUTING.md#node-version) installed, either on the path or at `NODE_DIR` (an environment variable or
 `make` parameter).
 
 Running with `make EXTRA_ARGS='--language LANG'` will allow you to load `LANG` exclusively, where `LANG` is one for the
diff --git a/etc/scripts/find-node b/etc/scripts/find-node
index b417df4b3..986114e43 100755
--- a/etc/scripts/find-node
+++ b/etc/scripts/find-node
@@ -24,8 +24,8 @@ find_node() {
 
 NODE="$(find_node)"
 
-NODE_MIN_VERSION=18
-NODE_VERSION_USED=20
+NODE_MIN_VERSION=20
+NODE_VERSION_USED=22
 NODE_VERSION=$(${NODE} --version)
 NODE_MAJOR_VERSION=$(echo "${NODE_VERSION}" | cut -f1 -d. | sed 's/^v//g')
 
diff --git a/package.json b/package.json
index 206940f75..7548b51a9 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
   },
   "version": "0.0.3",
   "engines": {
-    "node": ">=18.19.0"
+    "node": ">=20.0.0"
   },
   "main": "./app.ts",
   "dependencies": {


Test patch:
diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml
index 1da1b0f6b..2d8a54ae6 100644
--- a/.github/workflows/test-and-deploy.yml
+++ b/.github/workflows/test-and-deploy.yml
@@ -11,10 +11,10 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      - name: Use Node.js 20.x
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.x
+          node-version: 22.x
           check-latest: true
           cache: npm
       - name: Install prerequisites
@@ -37,12 +37,10 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      # We use 18.19.0 because it is the first backport to support --import
-      # https://raw.githubusercontent.com/nodejs/node/main/doc/changelogs/CHANGELOG_V18.md
-      - name: Use Node.js 18.19.0
+      - name: Use Node.js 20
         uses: actions/setup-node@v4
         with:
-          node-version: 18.19.0
+          node-version: 20.18.2
           check-latest: false
           cache: npm
       - name: Install prerequisites
@@ -64,10 +62,10 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      - name: Use Node.js 20.x
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.x
+          node-version: 22.x
           check-latest: true
           cache: npm
       - name: Build distribution
@@ -88,10 +86,10 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      - name: Use Node.js 20.x
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.x
+          node-version: 22.x
           check-latest: true
           cache: npm
       - name: Download the built distribution
diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml
index 5efe113f0..977b35499 100644
--- a/.github/workflows/test-frontend.yml
+++ b/.github/workflows/test-frontend.yml
@@ -11,10 +11,10 @@ jobs:
     steps:
       - name: Checkout repository
         uses: actions/checkout@v4
-      - name: Use Node.js 20.x
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.x
+          node-version: 22.x
           check-latest: true
           cache: npm
       - name: Install prerequisites
diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml
index c1330e75f..a17cba6e8 100644
--- a/.github/workflows/test-win.yml
+++ b/.github/workflows/test-win.yml
@@ -15,10 +15,11 @@ jobs:
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
-      - name: Use Node.js 20.12.1
+      - name: Use Node.js 22.x
         uses: actions/setup-node@v4
         with:
-          node-version: 20.12.1
+          node-version: 22.x
+          check-latest: true
           cache: npm
       - name: Install prerequisites
         run: make prereqs