Node.js 20 to 22 to 24 to 26: Upgrade Path, Breaking Changes and a Test Plan
Node 20 is end-of-life. This guide walks the upgrade 20 to 22 to 24 to 26 one step at a time: what each release removed or deprecated, which changes hit Express and Mongoose apps, a grep and deprecation-flag checklist, a CI matrix and a rollout plan.

Move from Node.js 20 to 26 in three tested steps: 20 to 22, 22 to 24, then 24 to 26. Node 20 reached end-of-life on 30 April 2026, so it no longer gets security fixes. Nothing forces you to stop at each line, and you can ship straight to 26 once the work is done, but running your test suite on each step means every failure points at one release's changes. Each step below lists what was removed, deprecated or changed in the official release notes, and what that means for an Express and Mongoose style API. For the dates, support phases and which line to choose today, see Which Node.js version to run in production; this post does not repeat them.
The four lines on 5 November 2026
| Line | Status | End of life | V8 | Bundled npm | NODE_MODULE_VERSION |
|---|---|---|---|---|---|
| 20 (20.20.2) | End-of-life | 2026-04-30 | 11.3 | 10.8.2 | 115 |
| 22 (22.23.4) | Maintenance LTS | 2027-04-30 | 12.4 | 10.9.9 | 127 |
| 24 (24.22.2) | Maintenance LTS | 2028-04-30 | 13.6 | 11.19.1 | 137 |
| 26 (26.13.0) | Active LTS | 2029-04-30 | 14.6 | 11.20.0 | 147 |
The dates come from the nodejs/Release schedule.json and the versions from the nodejs.org download index on 5 November 2026. The last column matters for native addons: a compiled .node file built for one value does not load under another, so every step needs a rebuild.
Step 1: Node 20 to 22
The 22.0.0 release notes list few removals and several behaviour changes:
require()of ES modules. The 22.0.0 notes added support for requiring synchronous ESM graphs behind a flag, and the 22.12.0 notes say it is "now no longer behind a flag on v22.x". It can still throwERR_REQUIRE_ASYNC_MODULEif the module or its dependencies use top-levelawait. Check support withprocess.features.require_module. This is a feature, but it changes how some CommonJS apps can consume ESM-only packages.- Import assertions are dropped.
import data from './x.json' assert { type: 'json' }no longer works. Use import attributes (with { type: 'json' }), which the 22.12.0 notes mark stable together with JSON modules. crypto.createCipherandcreateDecipherare end-of-life. Use theivvariants with a proper key derivation.- Runtime deprecations now print warnings: the
util.is*()helpers (such asutil.isArray; the 23.0.0 notes moved most of them to end-of-life),util.log(also end-of-life in 23), theHashandHmacconstructors, thefs.Statsconstructor and the--trace-atomics-waitflag. - Behaviour changes: the default stream
highWaterMarkwas bumped,httppreserves raw duplicate headers inwriteHeadaftersetHeadercalls, andconsole.assert()treats non-string arguments as separate arguments. Streaming endpoints and anything that sets headers twice deserve a test. - V8 12.4 (Maglev enabled on supported architectures), a global WebSocket client,
node --run,fs.globand a stable watch mode.NODE_MODULE_VERSIONis 127.
Step 2: Node 22 to 24
The 24.0.0 notes remove or deprecate many old APIs, most of which had been on a deprecation path for years:
- Removed or end-of-life:
tls.createSecurePair(DEP0064),OutgoingMessage_headersand_headerNames(DEP0066),dirent.path(usedirent.parentPath),fs.truncatewith a file descriptor,tls.Server.prototype.setOptionsandnet._setSimultaneousAccepts(). - Runtime-deprecated:
url.parse()(usenew URL()),SlowBuffer,fs.F_OK,R_OK,W_OKandX_OK(usefs.constants.F_OKand friends), passing invalid types tofs.existsSync, calling zlib classes or the REPL withoutnew, and passingargstospawnandexecFile. AsyncLocalStoragenow defaults toAsyncContextFrame. If you carry a request id through logging or a tenant id through your data layer with it, test that the value survives everyawait, stream and callback boundary you use.- Tooling: V8 13.6 (
Float16Array,RegExp.escape, explicit resource management), npm 11, Undici 7 behind globalfetch(), andURLPatternas a global. The permission flag--experimental-permissionbecame--permission. - Test runner: it now waits for subtests automatically, and the promises returned by
test()andt.test()were removed.NODE_MODULE_VERSIONis 137.
Because Node 22 ships npm 10 and 24 ships npm 11, step 2 is also where newer npm settings become available. Those settings are covered in protecting a Node.js project from npm supply-chain attacks.
Step 3: Node 24 to 26 (including what Node 25 removed)
Node 25 was a Current-only line that never became LTS, and it is end-of-life. Its removals are part of the 24-to-26 jump, so read both sets of notes.
- Removed in 25:
SlowBuffer(end-of-life, DEP0030),fs.F_OKand the other access constants, thefs.rmdirrecursiveoption (usefs.rm),assert.CallTracker, theprocessmultipleResolvesevent and closing aFileHandleon garbage collection. - Corepack is no longer distributed with Node from 25 on. If your build runs
corepack enableto provide pnpm or Yarn, provision your package manager another way before the upgrade. - Web Storage is enabled by default from 25. In 26, reading the global
localStoragewithout--localstorage-filereturnsundefined, which matters to SSR code that probes for it. - Removed in 26:
http.Server.prototype.writeHeader()(usewriteHead()), the legacy_stream_wrap,_stream_readable,_stream_writable,_stream_duplex,_stream_transformand_stream_passthroughmodules, and the--experimental-transform-typesflag. DEP0182 (short GCM authentication tags without an explicitauthTagLength) is end-of-life, so pass the tag length when you decrypt AES-GCM data. - Runtime-deprecated in 26:
module.register(), and DEP0201, DEP0203 and DEP0204 (stream andCryptoKeyrelated). - New: the Temporal API is on by default, V8 14.6 and Undici 8.
NODE_MODULE_VERSIONis 147.
The test plan
1. Inventory before you change anything
List which dependencies declare a Node range, which ones are compiled, and which Node version every environment really uses (local, CI, Docker, host). Update engines and .nvmrc in the same pull request as each step.
find node_modules -name "*.node" # compiled addons: rebuild or replace for every step
npm query "*" | node -e "
const pkgs = JSON.parse(require('fs').readFileSync(0, 'utf8'));
for (const p of pkgs) if (p.engines?.node) console.log(p.name + '@' + p.version, p.engines.node);
" | sort -u
2. Search for removed and deprecated APIs
git grep -nE "createCipher\(|createDecipher\(|assert \{ type" -- "*.js" "*.ts" "*.mjs"
git grep -nE "url\.parse\(|SlowBuffer|fs\.(F|R|W|X)_OK|createSecurePair|\.writeHeader\(|_stream_"
git grep -nE "rmdir\(.*recursive|multipleResolves|CallTracker|dirent\.path|module\.register\("
3. Make Node report what it hits at runtime
The Node.js CLI documents --trace-deprecation ("Print stack traces for deprecations"), --throw-deprecation ("Throw errors for deprecations") and --pending-deprecation, which is off by default and also switchable with NODE_PENDING_DEPRECATION=1. Run your tests with them, because warnings inside dependencies are the ones you will not find with grep:
NODE_OPTIONS=--trace-deprecation npm test # where does each warning come from?
NODE_OPTIONS=--throw-deprecation npm test # turn warnings into failures
NODE_PENDING_DEPRECATION=1 npm test # also show pending deprecations
4. Run CI on the current and the target line
strategy:
fail-fast: false
matrix:
node: [22, 24, 26] # the line you run today and the lines you are heading to
steps:
- uses: actions/setup-node@v7 # pin to a commit SHA
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci # a fresh install rebuilds native addons for this Node
- run: npm test
5. Test the areas the changes touch
| Area | What to test | Changed in |
|---|---|---|
| Request context | Request ids and tenant ids still arrive in logs and queries after awaits, streams and callbacks | 24 (AsyncLocalStorage) |
| HTTP and streams | Duplicate headers, file downloads and uploads, large responses, backpressure | 22 (writeHead, highWaterMark), 26 (writeHeader removed) |
| Crypto and auth | Tokens issued before the upgrade still verify, AES-GCM decrypt passes authTagLength | 22 (createCipher), 26 (DEP0182) |
| URLs | Routes and redirects that used url.parse() | 24 (runtime deprecation) |
| ES modules | ESM-only packages from CommonJS code, JSON imports | 22 (require(esm), import attributes) |
| Native addons and images | Clean install, container build, start-up on the real base image | every step (NODE_MODULE_VERSION) |
| Dates | Code that adds Temporal polyfills or checks for its absence | 26 |
| Build tooling | corepack enable, test runner scripts, flags in NODE_OPTIONS | 24 (test runner), 25 (Corepack), 26 (flags) |
6. Roll out and watch
Deploy the new line to staging with the exact production image, soak it, and compare error rates, memory and latency against your own baseline from the old line. This post gives no benchmark numbers, because none come from a primary source and your workload decides what matters. Keep the previous image tag deployable so rollback is a redeploy, and change one line per release so you can tell the changes apart. The HTTP status codes reference is handy when you decide which health-check responses should mean "not ready".
Frequently asked questions
Can I go from 20 straight to 26?
Technically yes, and the end state is the same. The stepped path just splits the work: failures appear in the step whose notes explain them. If your test coverage is strong and you have no native addons, a direct jump with the checklist above is reasonable.
Should I stop at 22 or 24?
Treat them as stepping stones. Node 22 reaches end-of-life on 30 April 2027, so landing there means doing the work again within months. Node 24 is a safe place to pause during a change freeze, since it is supported until 30 April 2028.
What about Node 25?
Skip it. It never became LTS and it is end-of-life, so there is no reason to run it in production.
If you would rather hand the upgrade to someone who does it regularly, see my Node.js and Express API development service.
Sources
- nodejs/Release schedule.json and the nodejs.org download index (versions, V8, npm, module versions)
- Release notes: 22.0.0, 22.12.0, 24.0.0, 25.0.0 and 26.0.0
- Node.js 23.0.0 release notes (end-of-life for most
util.is*()helpers) - Node.js deprecations (DEP0030, DEP0064, DEP0066, DEP0182)
- Node.js CLI options (deprecation flags) and fs API (
dirent.parentPath,fs.constants) - nodejs/node#61333 (localStorage without
--localstorage-file)




