Skip to content

Commit 64caf88

Browse files
committed
blog: add Migrating from Node.js 22 to Node.js 24
Summarize breaking and important changes when migrating from Node.js 22 LTS to Node.js 24 LTS.
1 parent e14424a commit 64caf88

File tree

1 file changed

+212
-0
lines changed

1 file changed

+212
-0
lines changed
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
---
2+
date: '2025-10-28T00:00:00.000Z'
3+
category: announcements
4+
title: 'Migrating from Node.js 22 LTS to Node.js 24 LTS'
5+
layout: blog-post
6+
author: The Node.js Project
7+
---
8+
9+
With the release of [Node.js 24.11.0][], the Node.js 24 release line has entered Long-Term Support (LTS) and will continue to receive updates through to the end of April 2028.
10+
11+
If you are migrating from Node.js 22 LTS, this article summarizes the breaking changes that came in [Node.js 23.0.0][] and [Node.js 24.0.0][].
12+
13+
## Platform support
14+
15+
Node.js no longer provides [pre-built binaries][] for:
16+
17+
- 32-bit Windows (x86) as of Node.js 23.0.0.
18+
- 32-bit Linux on armv7 as of Node.js 24.0.0.
19+
20+
Pre-built binaries for macOS now require a minimum of macOS 13.5.
21+
22+
Pre-built binaries for Linux on arm64, ppc64le, s390x and x64 continue to be compatible with glibc 2.28 and above (no change from Node.js 22).
23+
24+
Please refer to [additional notes if you are building Node.js from source](#building-nodejs-from-source).
25+
26+
## Assistance with updating source-code
27+
28+
For some breaking changes, and adoption of some new features, [Node.js provided migrations][userland migrations] are available to aid source-code modifications.
29+
30+
## Breaking changes
31+
32+
### Deprecated APIs
33+
34+
#### Removed APIs
35+
36+
- [`Cipher` and `Decipher`][DEP0106] classes from `node:crypto`.
37+
- [`dirent.path`][DEP0178].
38+
- [`fs.truncate()` using a file descriptor][DEP0081].
39+
- [`OutgoingMessage.prototype._headers`, `OutgoingMessage.prototype._headerNames`][DEP0066] from the `node:http` module.
40+
- [HTTP/2 priority signaling][DEP0194].
41+
- [`net._setSimultaneousAccepts()`][DEP0121].
42+
- [`process.assert()`][DEP0100].
43+
- [`timers.active()`][DEP0126].
44+
- [`timers.enroll()`][DEP0095].
45+
- [`timers.unenroll()`][DEP0096].
46+
- [`timers._unrefActive()`][DEP0127].
47+
- [`tls.createSecurePair()`][DEP0064].
48+
- [`tls.SecurePair`][DEP0043].
49+
- [`tls` `Server.prototype.setOptions()`][DEP0122].
50+
- [`util.isBoolean()`][DEP0045].
51+
- [`util.isBuffer()`][DEP0046].
52+
- [`util.isDate()`][DEP0047].
53+
- [`util.isError()`][DEP0048].
54+
- [`util.isFunction()`][DEP0049].
55+
- [`util.isNull()`][DEP0050].
56+
- [`util.isNullOrUndefined()`][DEP0051].
57+
- [`util.isNumber()`][DEP0052].
58+
- [`util.isObject()`][DEP0053].
59+
- [`util.isPrimitive()`][DEP0054].
60+
- [`util.isRegExp()`][DEP0055].
61+
- [`util.isString()`][DEP0056].
62+
- [`util.isSymbol()`][DEP0057].
63+
- [`util.isUndefined()`][DEP0058].
64+
- [`util.log()`][DEP0059].
65+
- [`util._extend()`][DEP0060].
66+
- [`zlib.bytesRead`][DEP0108].
67+
- Internal process bindings for `async_wrap`, `crypto`, `http_parser`, `signal_wrap`, `url`, and `v8`.
68+
69+
#### Removed command-line options
70+
71+
- [`--trace-atomics-wait`][DEP0165].
72+
73+
The following command-line options have been removed as they referred to features that are no longer experimental:
74+
75+
- `--no-experimental-global-customevent`.
76+
- `--no-experimental-fetch`.
77+
- `--no-experimental-global-webcrypto`.
78+
79+
#### New runtime deprecations
80+
81+
Runtime deprecations result in warnings being printed to the console when first used.
82+
83+
- [`SlowBuffer`][DEP0030] class.
84+
- [`crypto.fips`][DEP0093].
85+
- [`fs.existsSync` with invalid argument types][DEP0187].
86+
- [`fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`][DEP0176].
87+
- [Instantiating `node:repl` classes without `new`][DEP0185].
88+
- [Instantiating `node:zlib` classes without `new`][DEP0184].
89+
- [Passing `args` to `node:child_process` `execFile`/`spawn` with `shell` option `true`][DEP0190].
90+
- [Short GCM authentication tags without explicit `authTagLength`][DEP0182].
91+
- [`url.parse()`][DEP0169].
92+
93+
### OpenSSL 3.5
94+
95+
Pre-built binaries of Node.js 24 LTS, or builds using the default build configuration options, include OpenSSL 3.5. While Node.js 22 LTS got OpenSSL 3.5 in [Node.js 22.20.0][], the default [security level][openssl-security-level] was lowered there to match the [default security level in OpenSSL 3.0 of `1`][openssl30seclevel] to minimize disruption when updating within the Node.js 22 release line. Node.js 24 LTS uses the [default security level from OpenSSL 3.5 of `2`][openssl35seclevel], which means that:
96+
97+
- RSA, DSA and DH keys shorter than 2048 bits and ECC keys shorter than 224 bits are prohibited.
98+
- Any cipher suite using RC4 is also prohibited.
99+
100+
### Other changes of behavior
101+
102+
- Stricter `fetch()` compliance, including removal of support for third party `Blob`, `FormData`, and `AbortController` [#56070](https://github.com/nodejs/node/pull/56070).
103+
- Stricter validation of `AbortSignal` [#54965](https://github.com/nodejs/node/pull/54965).
104+
- [`CloseEvent`][CloseEvent], `Float16Array` and [`URLPattern`][URLPattern] have now been added to the [Global object][].
105+
- Attempting to pipe to a closed or destroyed stream will now result in a `ERR_STREAM_UNABLE_TO_PIPE` error [#53241](https://github.com/nodejs/node/pull/53241).
106+
- The ESM CommonJS wrapper now exports 'module.exports' [#53848](https://github.com/nodejs/node/pull/53848).
107+
- `buffer.File` is now cloneable [#47613](https://github.com/nodejs/node/pull/47613).
108+
- New requests on existing HTTP/2 connections will not be able to do so once server close is initiated [#57586](https://github.com/nodejs/node/pull/57586).
109+
- Streams now catch and forward errors from `dest.write()` [#55270](https://github.com/nodejs/node/pull/55270).
110+
- `readline` no longer ignores unicode line separators [#57591](https://github.com/nodejs/node/pull/57591).
111+
- Calling `readline.pause()`, `readline.resume()` or `readline.write()` on a closed `readline` interface now results in a `ERR_USE_AFTER_CLOSE` error [#57680](https://github.com/nodejs/node/pull/57680)
112+
- The `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` error has been corrected to `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` [#52627](https://github.com/nodejs/node/pull/52627).
113+
- `EventEmitterAsyncResource` fields are now private [#54889](https://github.com/nodejs/node/pull/54889).
114+
- Async context frame added to `AsyncResource` [#56082](https://github.com/nodejs/node/pull/56082).
115+
- `AsyncLocalStorage` now defaults to `AsyncContextFrame` [#55552](https://github.com/nodejs/node/pull/55552).
116+
117+
#### Argument/option validation
118+
119+
The following API's have changed how arguments/options are validated:
120+
121+
- Buffer API's now throw when writing beyond the end of the buffer [#54588](https://github.com/nodejs/node/pull/54588).
122+
- when writing a string to a buffer, or calling `buffer.toString()` on a large buffer, `buflen` is now capped within integer range [#51821](https://github.com/nodejs/node/pull/51821).
123+
- `fs.symlink()` no longer allows non-string values for the `type` option [#49741](https://github.com/nodejs/node/pull/49741).
124+
- `timers.clearImmediate` for the `immediate` argument [#57069](https://github.com/nodejs/node/pull/57069).
125+
- Timers now emit a warning if delay is negative or `NaN` [#46678](https://github.com/nodejs/node/pull/46678).
126+
- `server.listen()` host name validation [#54470](https://github.com/nodejs/node/pull/54470).
127+
- Long path names for pipes no longer truncate the pathname and instead throw an error [#52347](https://github.com/nodejs/node/pull/52347).
128+
- string_decoder encoding validation [#54957](https://github.com/nodejs/node/pull/54957).
129+
- `ERR_CRYPTO_SCRYPT_INVALID_PARAMETER` has been removed [#53305](https://github.com/nodejs/node/pull/53305).
130+
131+
#### Path handling
132+
133+
- Path handling on Windows with trailing slashes in `fs` API's is now consistent with other platforms [#54160](https://github.com/nodejs/node/pull/54160).
134+
- Bugs and inconsistencies in `path` handling [#54224](https://github.com/nodejs/node/pull/54224).
135+
136+
#### Test runner
137+
138+
- `WeakMap` and `WeakSet` comparison handling in `assert` and `util` API's has been changed [#53495](https://github.com/nodejs/node/pull/53495).
139+
- Detect only tests when `--test` is not used [#54881](https://github.com/nodejs/node/pull/54881).
140+
- The test runner now defaults to the `spec` reporter. TAP output is still available via the `--test-reporter=tap` CLI flag. [#54548](https://github.com/nodejs/node/pull/54548).
141+
- The `lcov` reporter is now exposed as a newable function to allow `options` to be set on it [#52403](https://github.com/nodejs/node/pull/52403).
142+
143+
### C/C++ addons
144+
145+
[Addons][] linking against V8 APIs may need to be updated for V8 13.6. This includes C++20 support needing to be enabled (previously C++17). Where possible, the project recommends using [NODE-API][] to avoid needing to recompile for new versions of V8.
146+
147+
### Building Node.js from source
148+
149+
If you are building Node.js from source, you may need to update your compiler toolchain.
150+
151+
- For AIX and Linux platforms, the minimum supported version of [gcc][] is 12.2.
152+
- For macOS the minimum supported version of [Xcode][] is 16.1.
153+
154+
Node.js' `configure` script will warn if you attempt to build Node.js with a compiler toolchain that does not meet the minimum supported version but will not actively prevent you from trying.
155+
156+
[Addons]: https://nodejs.org/docs/latest-v24.x/api/addons.html
157+
[CloseEvent]: https://nodejs.org/docs/latest-v24.x/api/globals.html#class-closeevent
158+
[DEP0043]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0043
159+
[DEP0045]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0045
160+
[DEP0046]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0046
161+
[DEP0047]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0047
162+
[DEP0048]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0048
163+
[DEP0049]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0049
164+
[DEP0050]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0050
165+
[DEP0051]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0051
166+
[DEP0052]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0052
167+
[DEP0053]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0053
168+
[DEP0054]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0054
169+
[DEP0055]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0055
170+
[DEP0056]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0056
171+
[DEP0057]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0057
172+
[DEP0058]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0058
173+
[DEP0059]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0059
174+
[DEP0060]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0060
175+
[DEP0064]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0064
176+
[DEP0066]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0066
177+
[DEP0030]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0030
178+
[DEP0081]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0081
179+
[DEP0093]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0093
180+
[DEP0095]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0095
181+
[DEP0096]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0096
182+
[DEP0100]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0100
183+
[DEP0106]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0106
184+
[DEP0108]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0108
185+
[DEP0121]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0121
186+
[DEP0122]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0122
187+
[DEP0126]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0126
188+
[DEP0127]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0127
189+
[DEP0165]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0165
190+
[DEP0169]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0169
191+
[DEP0176]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0176
192+
[DEP0178]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0178
193+
[DEP0182]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0182
194+
[DEP0184]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0184
195+
[DEP0185]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0185
196+
[DEP0187]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0187
197+
[DEP0190]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0190
198+
[DEP0194]: https://nodejs.org/docs/latest-v24.x/api/deprecations.html#DEP0194
199+
[gcc]: https://gcc.gnu.org/
200+
[Global object]: https://nodejs.org/docs/latest-v24.x/api/globals.html
201+
[NODE-API]: https://nodejs.org/docs/latest-v24.x/api/addons.html#node-api
202+
[Node.js 22.20.0]: https://nodejs.org/blog/release/v22.20.0
203+
[Node.js 23.0.0]: https://nodejs.org/blog/release/v23.0.0
204+
[Node.js 24.0.0]: https://nodejs.org/blog/release/v24.0.0
205+
[Node.js 24.11.0]: https://nodejs.org/blog/release/v24.11.0
206+
[openssl30seclevel]: https://docs.openssl.org/3.0/man3/SSL_CTX_set_security_level/
207+
[openssl35seclevel]: https://docs.openssl.org/3.5/man3/SSL_CTX_set_security_level/
208+
[openssl-security-level]: https://nodejs.org/docs/latest-v24.x/api/tls.html#openssl-security-level
209+
[pre-built binaries]: https://nodejs.org/en/download
210+
[userland migrations]: https://nodejs.org/en/learn/migrations/introduction
211+
[URLPattern]: https://nodejs.org/docs/latest-v24.x/api/globals.html#class-urlpattern
212+
[Xcode]: https://developer.apple.com/xcode/

0 commit comments

Comments
 (0)