Skip to content

Commit 14b3042

Browse files
authored
chore: update minimal supported version of node to v20 (#6982)
1 parent 035fb94 commit 14b3042

File tree

36 files changed

+191
-154
lines changed

36 files changed

+191
-154
lines changed

.changeset/sharp-views-scream.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
"@nomicfoundation/hardhat-ignition-ethers": minor
3+
"@nomicfoundation/hardhat-network-helpers": minor
4+
"@nomicfoundation/hardhat-chai-matchers": minor
5+
"@nomicfoundation/ignition-core": minor
6+
"@nomicfoundation/hardhat-ignition-viem": minor
7+
"@nomicfoundation/hardhat-toolbox-viem": minor
8+
"@nomiclabs/hardhat-web3-legacy": minor
9+
"hardhat-shorthand": minor
10+
"@nomicfoundation/hardhat-ignition": minor
11+
"@nomiclabs/hardhat-truffle4": minor
12+
"@nomiclabs/hardhat-truffle5": minor
13+
"@nomicfoundation/hardhat-foundry": minor
14+
"@nomiclabs/hardhat-solhint": minor
15+
"@nomicfoundation/hardhat-toolbox": minor
16+
"@nomicfoundation/hardhat-web3-v4": minor
17+
"@nomicfoundation/hardhat-ethers": minor
18+
"@nomicfoundation/hardhat-ledger": minor
19+
"@nomicfoundation/hardhat-verify": minor
20+
"@nomiclabs/hardhat-solpp": minor
21+
"@nomiclabs/hardhat-vyper": minor
22+
"hardhat": minor
23+
"@nomicfoundation/hardhat-viem": minor
24+
"@nomiclabs/hardhat-web3": minor
25+
---
26+
27+
Updated the minimal supported version of Node to v20 ([#6982](https://github.com/NomicFoundation/hardhat/pull/6982))

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {
6-
"version": "18"
6+
"version": "20"
77
}
88
},
99
"postCreateCommand": "scripts/setup.sh",

.github/actions/setup-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
node-version:
1010
description: Version of node to install
1111
required: false
12-
default: "18"
12+
default: "20"
1313
cache-save:
1414
description: Whether to save the pnpm cache
1515
required: false

.github/workflows/hardhat-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-node@v4
3232
with:
33-
node-version: 18
33+
node-version: 20
3434
- run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json
3535
- id: generate
3636
env:

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
node: [18.15]
42+
node: [20]
4343
os: ["macos-13", "ubuntu-latest", "windows-latest"]
4444
steps:
4545
- uses: actions/checkout@v4
@@ -77,7 +77,7 @@ jobs:
7777
strategy:
7878
fail-fast: false
7979
matrix:
80-
node: [18.15]
80+
node: [20]
8181
os: ["macos-13", "ubuntu-latest", "windows-latest"]
8282
steps:
8383
- uses: actions/checkout@v4
@@ -111,6 +111,7 @@ jobs:
111111
name: Test different versions of @types/node
112112
runs-on: ubuntu-latest
113113
strategy:
114+
fail-fast: false
114115
matrix:
115116
# TODO: Currently there is no @types/node for Node 24,
116117
# include it when it is available.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

packages/hardhat-chai-matchers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@types/bn.js": "^5.1.0",
4646
"@types/chai": "^4.2.0",
4747
"@types/mocha": ">=9.1.0",
48-
"@types/node": "^18.0.0",
48+
"@types/node": "^20.0.0",
4949
"@typescript-eslint/eslint-plugin": "5.61.0",
5050
"@typescript-eslint/parser": "5.61.0",
5151
"bignumber.js": "^9.0.2",

packages/hardhat-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@types/keccak": "^3.0.1",
7070
"@types/lodash": "^4.14.123",
7171
"@types/mocha": ">=9.1.0",
72-
"@types/node": "^18.0.0",
72+
"@types/node": "^20.0.0",
7373
"@types/resolve": "^1.17.1",
7474
"@types/semver": "^6.0.2",
7575
"@types/sinon": "^9.0.8",

packages/hardhat-core/src/builtin-tasks/compile.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,19 @@ subtask(TASK_COMPILE_SOLIDITY_READ_FILE)
163163
encoding: "utf8",
164164
});
165165
} catch (e) {
166-
if (fsExtra.lstatSync(absolutePath).isDirectory()) {
167-
throw new HardhatError(ERRORS.GENERAL.INVALID_READ_OF_DIRECTORY, {
168-
absolutePath,
169-
});
166+
let err = e;
167+
try {
168+
if (fsExtra.lstatSync(absolutePath).isDirectory()) {
169+
err = new HardhatError(ERRORS.GENERAL.INVALID_READ_OF_DIRECTORY, {
170+
absolutePath,
171+
});
172+
}
173+
} catch (_) {
174+
// ignore
170175
}
171176

172177
// eslint-disable-next-line @nomicfoundation/hardhat-internal-rules/only-hardhat-error
173-
throw e;
178+
throw err;
174179
}
175180
}
176181
);
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
// TODO: Remove 18 on June 30, 2025
2-
export const SUPPORTED_NODE_VERSIONS = [
3-
"^18.0.0",
4-
"^20.0.0",
5-
"^22.0.0",
6-
"^24.0.0",
7-
];
1+
export const SUPPORTED_NODE_VERSIONS = ["^20.0.0", "^22.0.0", "^24.0.0"];

0 commit comments

Comments
 (0)