Skip to content

chore!: Drop Node 18 and 20 - #9976

Open
Mrtenz wants to merge 3 commits into
mainfrom
mrtenz/drop-node-20
Open

chore!: Drop Node 18 and 20#9976
Mrtenz wants to merge 3 commits into
mainfrom
mrtenz/drop-node-20

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Aug 26, 2026

Copy link
Copy Markdown
Member

Node 18 and 20 are EOL, we should not support them anymore. This PR makes a breaking change to every single package in the monorepo. This also reduces the number of jobs we need to run in CI.

This change was originally merged into the esm feature branch, but using a stacked pull request seems cleaner here.


Note

Medium Risk
Semver-breaking for all published packages: consumers on Node 18/20 must upgrade. Runtime code changes are mostly test/CI and polyfill removal, but the blast radius across the monorepo is large.

Overview
BREAKING: The monorepo now requires Node.js ^22.14.0 or ^24 everywhere—root and every workspace engines.node, enforced in yarn.config.cjs (including @metamask/wallet-cli, which previously allowed >=20).

CI in lint-build-test.yml drops 18.x and 20.x: prepare and per-package tests run only on 22.x and 24.x (the old test-18 / test-20 matrix jobs are removed). Wallet-cli daemon e2e likewise drops Node 20 from its matrix.

Dev tooling aligns with Node 22: root and several packages bump @types/node from 16.x to ^22.13.14, with lockfile updates.

Test harness cleanup assumes Node’s built-in Web Crypto: custom Jest environments and beforeAll webcrypto shims are removed from packages such as keyring-controller, passkey-controller, seedless-onboarding-controller, and money-account-upgrade-controller; partial crypto polyfills are trimmed where a custom env remains. platform-api-docs drops the old fs.cp Node-range eslint workaround.

Each affected package records the change under Unreleased (or the relevant release section) as a BREAKING minimum Node bump (#9168).

Reviewed by Cursor Bugbot for commit 12ce9cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@Mrtenz Mrtenz changed the title chore!: Drop Node 18 and 20 (#9168) chore!: Drop Node 18 and 20 Aug 26, 2026
Comment thread package.json
@Mrtenz
Mrtenz force-pushed the mrtenz/drop-node-20 branch 2 times, most recently from 00f0bc1 to beac0dd Compare August 26, 2026 18:49
@socket-security

socket-security Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​types/​node@​16.18.106 ⏵ 22.20.11001008196100

View full report

@Mrtenz
Mrtenz force-pushed the mrtenz/drop-node-20 branch from beac0dd to 8dabedc Compare August 27, 2026 08:50
@Mrtenz
Mrtenz marked this pull request as ready for review August 27, 2026 11:54
@Mrtenz
Mrtenz requested review from a team as code owners August 27, 2026 11:54
@Mrtenz
Mrtenz deployed to default-branch August 27, 2026 11:54 — with GitHub Actions Active
@Mrtenz
Mrtenz requested review from a team as code owners August 27, 2026 11:54

### Changed

- **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these PR numbers outdated? I believe that's why the changelog check action is failing:

Suggested change
- **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
- **BREAKING:** Bump minimum Node.js version to 22 ([#9976](https://github.com/MetaMask/core/pull/9976))

(and so on, for the other packages)

@Mrtenz
Mrtenz force-pushed the mrtenz/drop-node-20 branch from 8dabedc to 0eaec02 Compare August 27, 2026 21:31
Comment thread .github/workflows/lint-build-test.yml Fixed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0eaec02. Configure here.

Comment thread .github/workflows/lint-build-test.yml
@Mrtenz
Mrtenz force-pushed the mrtenz/drop-node-20 branch 2 times, most recently from a496078 to 6312a0f Compare August 28, 2026 11:07
FrederikBolding and others added 3 commits August 28, 2026 13:08
Node 18 and 20 are EOL, we should not support them anymore. This PR
makes a breaking change to every single package in the monorepo. This
also reduces the number of jobs we need to run in CI.

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **High Risk**
> Semver-breaking platform change across all packages: consumers on Node
18/20 must upgrade before adopting new releases. CI no longer catches
regressions on those versions.
>
> **Overview**
> **BREAKING:** The monorepo now requires **Node.js `^22.14.0 || ^24`**
everywhere. Root and every workspace `package.json` `engines.node` moves
off `^18.18 || >=20`, and `yarn.config.cjs` enforces the same range
(including `@metamask/wallet-cli`, which previously allowed `>=20`).
>
> CI in `lint-build-test.yml` stops testing on **18.x** and **20.x**:
the prepare matrix and per-package test jobs run only **22.x** and
**24.x**, with `test-18` / `test-20` removed and `test-24` added. Each
package’s **Unreleased** changelog records the Node bump.
>
> Because Node 22 exposes **Web Crypto** globally, custom Jest setups
that assigned `crypto.webcrypto` are removed (`keyring-controller`,
`passkey-controller`, `seedless-onboarding-controller`,
`money-account-upgrade-controller`, and partial cleanup in
`notification-services-controller` / `profile-sync-controller`). Related
`jest-environment-node` devDependencies and `Wallet` / encryptor test
`beforeAll` polyfills go away. `platform-api-docs` drops the comment
justifying `fs.cp` on older Node versions.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
50b2f4c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
@Mrtenz
Mrtenz force-pushed the mrtenz/drop-node-20 branch from 6312a0f to 12ce9cf Compare August 28, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants