Skip to content

Commit d8eff35

Browse files
committed
feat: add support for Node.js v22
This commit adds Node.js v22 support by including it in our testing matrices, including it in the supported version list and updating the docs to reflect the v22 support. Node.js v22 was not added to the @types/node CI check. As of today (13th June 2024), there is no `@types/node@22`. I suspect this will be added once node v22 is out of `Current` status. Resolves #5388.
1 parent bdd04d3 commit d8eff35

21 files changed

+29
-27
lines changed

.github/workflows/hardhat-chai-matchers-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
runs-on: ubuntu-latest
7373
strategy:
7474
matrix:
75-
node: [18, 20]
75+
node: [18, 20, 22]
7676
steps:
7777
- uses: actions/checkout@v4
7878
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-core-ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ jobs:
118118
runs-on: ubuntu-latest
119119
strategy:
120120
matrix:
121+
# TODO: Currently there is no @types/node for Node 22,
122+
# include it when it is available.
121123
node: [18, 20]
122124
steps:
123125
- uses: actions/checkout@v4

.github/workflows/hardhat-ethers-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-foundry-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
runs-on: ubuntu-latest
7373
strategy:
7474
matrix:
75-
node: [18, 20]
75+
node: [18, 20, 22]
7676
steps:
7777
- uses: actions/checkout@v4
7878
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-ledger-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
runs-on: ubuntu-latest
7272
strategy:
7373
matrix:
74-
node: [18, 20]
74+
node: [18, 20, 22]
7575
steps:
7676
- uses: actions/checkout@v4
7777
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-network-helpers-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
runs-on: ubuntu-latest
7575
strategy:
7676
matrix:
77-
node: [18, 20]
77+
node: [18, 20, 22]
7878
steps:
7979
- uses: actions/checkout@v4
8080
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-network-tracing-all-solc-versions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
node: [18, 20]
22+
node: [18, 20, 22]
2323
steps:
2424
- uses: actions/checkout@v4
2525
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-shorthand-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-solhint-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-solpp-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
strategy:
5353
matrix:
54-
node: [18, 20]
54+
node: [18, 20, 22]
5555
steps:
5656
- uses: actions/checkout@v4
5757
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-toolbox-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
runs-on: ubuntu-latest
7979
strategy:
8080
matrix:
81-
node: [18, 20]
81+
node: [18, 20, 22]
8282
steps:
8383
- uses: actions/checkout@v4
8484
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-truffle4-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
runs-on: ubuntu-latest
7373
strategy:
7474
matrix:
75-
node: [18, 20]
75+
node: [18, 20, 22]
7676
steps:
7777
- uses: actions/checkout@v4
7878
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-truffle5-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
runs-on: ubuntu-latest
7373
strategy:
7474
matrix:
75-
node: [18, 20]
75+
node: [18, 20, 22]
7676
steps:
7777
- uses: actions/checkout@v4
7878
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-verify-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-viem-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-vyper-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
35-
node: [18, 20]
35+
node: [18, 20, 22]
3636
steps:
3737
- uses: actions/checkout@v4
3838
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-web3-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-web3-legacy-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

.github/workflows/hardhat-web3-v4-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
strategy:
7272
matrix:
73-
node: [18, 20]
73+
node: [18, 20, 22]
7474
steps:
7575
- uses: actions/checkout@v4
7676
- uses: pnpm/action-setup@v2

docs/src/content/tutorial/setting-up-the-environment.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Copy and paste these commands in a terminal:
2121
```
2222
sudo apt update
2323
sudo apt install curl git
24-
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
24+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
2525
sudo apt-get install -y nodejs
2626
```
2727

@@ -33,9 +33,9 @@ There are multiple ways of installing Node.js on MacOS. We will be using [Node V
3333

3434
```
3535
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
36-
nvm install 20
37-
nvm use 20
38-
nvm alias default 20
36+
nvm install 22
37+
nvm use 22
38+
nvm alias default 22
3939
npm install npm --global # Upgrade npm to the latest version
4040
```
4141

@@ -61,12 +61,12 @@ If your version of Node.js is older and [not supported by Hardhat](../hardhat-ru
6161

6262
### MacOS
6363

64-
You can change your Node.js version using [nvm](http://github.com/creationix/nvm). To upgrade to Node.js `20.x` run these in a terminal:
64+
You can change your Node.js version using [nvm](http://github.com/creationix/nvm). To upgrade to Node.js `22.x` run these in a terminal:
6565

6666
```
67-
nvm install 20
68-
nvm use 20
69-
nvm alias default 20
67+
nvm install 22
68+
nvm use 22
69+
nvm alias default 22
7070
npm install npm --global # Upgrade npm to the latest version
7171
```
7272

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SUPPORTED_NODE_VERSIONS = ["^18.0.0", "^20.0.0"];
1+
export const SUPPORTED_NODE_VERSIONS = ["^18.0.0", "^20.0.0", "^22.0.0"];

0 commit comments

Comments
 (0)