Rafael Gonzaga

2024-10-16, Version 23.0.0 (Current), @RafaelGSS

We’re excited to announce the release of Node.js 23! Key highlights include:

  • Enabling require(esm) by default for Node.js applications
  • Removing support for Windows 32-bit systems
  • Stabilizing the node --run command
  • Enhancements to the test runner, including glob pattern support for coverage files

Node.js 23 will replace Node.js 22 as the ‘Current’ release line when Node.js 22 enters long-term support (LTS) later this month. According to the release schedule, Node.js 23 will remain the ‘Current’ release for the next six months, until April 2025.

require(esm) is now enabled by default

Support for loading native ES modules using require() had been available on v20.x and v22.x under the command line flag --experimental-require-module. In v23.x, this feature is now enabled by default. This feature is still experimental, and we are looking for user feedback to make more final tweaks before fully stabilizing it. For this reason, on v23.x, when the Node.js instance encounters a native ES module in require() for the first time, it will emit an experimental warning.

If there happens to be any regressions caused by this feature, users can report it to the Node.js issue tracker. Meanwhile this feature can also be disabled using --no-experimental-require-module as a workaround. We expect to test this feature using v23.x, find out any potential regressions and make adjustments accordingly, before backporting the unflagging to v22.x. This will likely happen in a later semver-minor release after the LTS promotion at the end of October.

With this feature enabled, Node.js will no longer throw ERR_REQUIRE_ESM if require() is used to load a ES module. It can, however, throw ERR_REQUIRE_ASYNC_MODULE if the ES module being loaded or its dependencies contain top-level await. When the ES module is loaded successfully by require(), the returned object will be a ES module namespace object similar to what's returned by import(), and can be checked using util.isModuleNamespaceObject().

Users can check process.features.require_module to see whether require(esm) is enabled in the current Node.js instance. For packages, the "module-sync" exports condition can be used as a way to detect require(esm) support in the current Node.js instance and allow both require() and import to load the same native ES module. See the documentation for more details about this feature.

Other Notable Changes

  • [7ad0cc3e57] - (SEMVER-MAJOR) build: remove support for 32-bit Windows (Michaël Zasso) #53184
  • [83eb4f2855] - (SEMVER-MINOR) deps: V8: cherry-pick cd10ad7cdbe5 (Joyee Cheung) #52535
  • [b8493a5789] - doc: add abmusse to collaborators (Abdirahim Musse) #55086
  • [7fab6e8885] - (SEMVER-MAJOR) doc: use gcc 12 on AIX for Node.js >=23 (Richard Lau) #54338
  • [d473606040] - (SEMVER-MINOR) lib: propagate aborted state to dependent signals before firing events (jazelly) #54826
  • [06206af181] - (SEMVER-MINOR) module: unflag --experimental-require-module (Joyee Cheung) #55085
  • [0b9249e335] - (SEMVER-MINOR) module: implement the "module-sync" exports condition (Joyee Cheung) #54648
  • [92a25abca9] - (SEMVER-MINOR) path: add matchGlob method (Aviv Keller) #52881
  • [12dd4c7575] - src: mark node --run as stable (Yagiz Nizipli) #53763
  • [4174b73153] - test: support glob matching coverage files (Aviv Keller) #53553

Semver-Major Commits

  • [764b13d75c] - (SEMVER-MAJOR) assert,util: change WeakMap and WeakSet comparison handling (Cristian Barlutiu) #53495
  • [3800d60c66] - (SEMVER-MAJOR) buffer: throw when writing beyond buffer" (Robert Nagy) #54588
  • [17fd32790a] - (SEMVER-MAJOR) buffer: make File cloneable (Matthew Aitken) #47613
  • [f68d7d2acc] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Michaël Zasso) #54536
  • [9d0748c5df] - (SEMVER-MAJOR) build: disable ICF for mksnapshot (Leszek Swirski) #54077
  • [b7bcf3e121] - (SEMVER-MAJOR) build: include v8-sandbox.h header in distribution (Michaël Zasso) #54077
  • [1dfa3b8255] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Michaël Zasso) #54077
  • [046343ea9d] - (SEMVER-MAJOR) build: warn for GCC versions earlier than 12.2 (Michaël Zasso) #54081
  • [a5decd4c8d] - (SEMVER-MAJOR) build: drop experimental support for Windows <10 (Michaël Zasso) #54079
  • [7ad0cc3e57] - (SEMVER-MAJOR) build: remove support for 32-bit Windows (Michaël Zasso) #53184
  • [c7e42092f3] - (SEMVER-MAJOR) build: compile with C++20 support (Michaël Zasso) #45427
  • [e2b7e41e23] - (SEMVER-MAJOR) child_process: remove unused internal event (Rich Trott) #53793
  • [4f1fe8a015] - (SEMVER-MAJOR) cli: remove deprecated V8 flag (Omer Katz) #54761
  • [8f37492b65] - (SEMVER-MAJOR) cli: move --trace-atomics-wait to eol (Marco Ippolito) #52747
  • [f7e73cd1f2] - (SEMVER-MAJOR) cli: remove --no-experimental-global-customevent flag (Daeyeon Jeong) #52723
  • [311504125f] - (SEMVER-MAJOR) cli: remove --no-experimental-fetch flag (Filip Skokan) #52611
  • [a30ae50860] - (SEMVER-MAJOR) cli: remove --no-experimental-global-webcrypto flag (Filip Skokan) #52564
  • [afe56aa58b] - (SEMVER-MAJOR) crypto: runtime deprecate crypto.fips (Yagiz Nizipli) #55019
  • [33a6d1fe3a] - (SEMVER-MAJOR) crypto: remove ERR_CRYPTO_SCRYPT_INVALID_PARAMETER (Tobias Nießen) #53305
  • [ff826069a8] - (SEMVER-MAJOR) crypto: move DEP0182 to runtime deprecation (Tobias Nießen) #52552
  • [6e150f9527] - (SEMVER-MAJOR) deps: V8: cherry-pick 97199f686e2f (Michaël Zasso) #54536
  • [1e16779fa1] - (SEMVER-MAJOR) deps: V8: cherry-pick 01a47f3ffff2 (Michaël Zasso) #54536
  • [762a440e68] - (SEMVER-MAJOR) deps: patch V8 to support older Clang versions (Michaël Zasso) #54536
  • [95f2213eed] - (SEMVER-MAJOR) deps: always define V8_NODISCARD as no-op (Michaël Zasso) #54536
  • [09d997f181] - (SEMVER-MAJOR) deps: fix FP16 bitcasts.h (Stefan Stojanovic) #54536
  • [1866363854] - (SEMVER-MAJOR) deps: patch V8 to support compilation with MSVC (StefanStojanovic) #54536
  • [6f4f22f84c] - (SEMVER-MAJOR) deps: patch V8 to avoid duplicated zlib symbol (Michaël Zasso) #54536
  • [dfff61475e] - (SEMVER-MAJOR) deps: disable V8 concurrent sparkplug compilation (Michaël Zasso) #54536
  • [69ad89f8eb] - (SEMVER-MAJOR) deps: always define V8_EXPORT_PRIVATE as no-op (Michaël Zasso) #54536
  • [5ab3140dfb] - (SEMVER-MAJOR) deps: update V8 to 12.9.202.18 (Michaël Zasso) #54536
  • [fba06eb34a] - (SEMVER-MAJOR) deps: remove bogus V8 DCHECK (Michaël Zasso) #54077
  • [5355603fb5] - (SEMVER-MAJOR) deps: V8: cherry-pick 00e9eeb3fb2c (Michaël Zasso) #54077
  • [bcc1e2716c] - (SEMVER-MAJOR) deps: V8: cherry-pick b1397772c70c (Michaël Zasso) #54077
  • [415bc750a5] - (SEMVER-MAJOR) deps: V8: cherry-pick 35888fee7bba (Joyee Cheung) #54077
  • [28f3e5c9d1] - (SEMVER-MAJOR) deps: always define V8_NODISCARD as no-op (Michaël Zasso) #54077
  • [a41c381cde] - (SEMVER-MAJOR) deps: fix FP16 bitcasts.h (Stefan Stojanovic) #54077
  • [16c9348e60] - (SEMVER-MAJOR) deps: V8: revert CL 5331688 (Michaël Zasso) #54077
  • [dc4e702a45] - (SEMVER-MAJOR) deps: patch V8 to support compilation with MSVC (StefanStojanovic) #54077
  • [f626acc328] - (SEMVER-MAJOR) deps: silence internal V8 deprecation warning (Michaël Zasso) #54077
  • [ed187faa64] - (SEMVER-MAJOR) deps: patch V8 to avoid duplicated zlib symbol (Michaël Zasso) #54077
  • [ed029bded7] - (SEMVER-MAJOR) deps: avoid compilation error with ASan (Michaël Zasso) #54077
  • [e600de93cf] - (SEMVER-MAJOR) deps: disable V8 concurrent sparkplug compilation (Michaël Zasso) #54077
  • [cc36db7c06] - (SEMVER-MAJOR) deps: always define V8_EXPORT_PRIVATE as no-op (Michaël Zasso) #54077
  • [9d7cd9b864] - (SEMVER-MAJOR) deps: update V8 to 12.8.374.13 (Michaël Zasso) #54077
  • [4f70132972] - (SEMVER-MAJOR) doc: reflect toolchains used for official binaries (Richard Lau) #54967
  • [7fab6e8885] - (SEMVER-MAJOR) doc: use gcc 12 on AIX for Node.js >=23 (Richard Lau) #54338
  • [1d5ed725e9] - (SEMVER-MAJOR) esm: export 'module.exports' on ESM CJS wrapper (Guy Bedford) #53848
  • [d5c29ba12d] - (SEMVER-MAJOR) events: set EventEmitterAsyncResource fields private (Yagiz Nizipli) #54889
  • [f202322ea4] - (SEMVER-MAJOR) fs: adjust typecheck for type in fs.symlink() (Livia Medeiros) #49741
  • [15e7563062] - (SEMVER-MAJOR) fs: runtime deprecate dirent.path (Antoine du Hamel) #51050
  • [00b2f07f9d] - (SEMVER-MAJOR) fs,win: fix bug in paths with trailing slashes (Hüseyin Açacak) #54160
  • [e973c3e94b] - (SEMVER-MAJOR) lib: validate signals with interface converter (Jason Zhang) #54965
  • [a5a946d8a5] - (SEMVER-MAJOR) lib: implement interface converter in webidl (Jason Zhang) #54965
  • [6ed93b4d69] - (SEMVER-MAJOR) lib: expose global CloseEvent (Matthew Aitken) #53355
  • [52322aa42a] - (SEMVER-MAJOR) net: validate host name for server listen (Jason Zhang) #54470
  • [efbba60e5b] - (SEMVER-MAJOR) path: fix bugs and inconsistencies (Hüseyin Açacak) #54224
  • [c237eabf4c] - (SEMVER-MAJOR) process: remove process.assert (Aviv Keller) #55035
  • [17a17164d6] - (SEMVER-MAJOR) src: update NODE_MODULE_VERSION to 131 (Michaël Zasso) #54536
  • [f0134fa6c3] - (SEMVER-MAJOR) src: stop using deprecated fields of v8::FastApiCallbackOptions (Andreas Haas) #54077
  • [0be79f4deb] - (SEMVER-MAJOR) src: remove dependency on wrapper-descriptor-based CppHeap (Joyee Cheung) #54077
  • [525b3f22d1] - (SEMVER-MAJOR) src: add source location to v8::TaskRunner (François Doray) #54077
  • [e945bd9525] - (SEMVER-MAJOR) src: update NODE_MODULE_VERSION to 129 (Michaël Zasso) #54077
  • [bb8d2936ab] - (SEMVER-MAJOR) src: do not use soon-to-be-deprecated V8 API (Igor Sheludko) #53174
  • [75884678d7] - (SEMVER-MAJOR) src: add UV_PIPE_NO_TRUNCATE for bind in pipe_wrap.cc (theanarkh) #52347
  • [922feb1ff5] - (SEMVER-MAJOR) stream: pipe to a closed or destroyed stream is not allowed in pipeline (jakecastelli) #53241
  • [ffe0dc5b87] - (SEMVER-MAJOR) string_decoder: refactor encoding validation (Yagiz Nizipli) #54957
  • [df9efba2ce] - (SEMVER-MAJOR) test: update v8-stats test for V8 12.6 (Michaël Zasso) #54077
  • [dbaef339aa] - (SEMVER-MAJOR) test_runner: detect only tests when --test is not used (Colin Ihrig) #54881
  • [eb7e18fe94] - (SEMVER-MAJOR) test_runner: always make spec the default reporter (Colin Ihrig) #54548
  • [0db38f0f99] - (SEMVER-MAJOR) test_runner: expose lcov reporter as newable function (Chemi Atlow) #52403
  • [f5ed3386fd] - (SEMVER-MAJOR) timers: emit warning if delay is negative or NaN (jakecastelli) #46678
  • [f666a1b754] - (SEMVER-MAJOR) tls: fix 'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED' typo (Aviv Keller) #52627
  • [c8c108f9b0] - (SEMVER-MAJOR) tools: add additonal include dirs for V8 on AIX (Abdirahim Musse) #54536
  • [64e8646618] - (SEMVER-MAJOR) tools: update V8 gypfiles for 12.8 (Michaël Zasso) #54077
  • [dc352a5ff2] - (SEMVER-MAJOR) tools: update V8 gypfiles for 12.7 (Richard Lau) #54077
  • [8044051ce3] - (SEMVER-MAJOR) tools: update V8 gypfiles for 12.6 (Michaël Zasso) #54077
  • [982f6ad516] - (SEMVER-MAJOR) util: move util.log to eol (marco-ippolito) #52744
  • [1d817dcb52] - (SEMVER-MAJOR) util: move util.isPrimitive to eol (marco-ippolito) #52744
  • [72240942ed] - (SEMVER-MAJOR) util: move util.isFunction to eol (marco-ippolito) #52744
  • [dc379626ab] - (SEMVER-MAJOR) util: move util.isError to eol (marco-ippolito) #52744
  • [b5cae4fea6] - (SEMVER-MAJOR) util: move util.isDate to eol (marco-ippolito) #52744
  • [bd559e3e5a] - (SEMVER-MAJOR) util: move util.isObject to eol (marco-ippolito) #52744
  • [d3068b9cfa] - (SEMVER-MAJOR) util: move util.isRegExp to eol (marco-ippolito) #52744
  • [a59c7aeb27] - (SEMVER-MAJOR) util: move util.isUndefined to eol (marco-ippolito) #52744
  • [05e72c939a] - (SEMVER-MAJOR) util: move util.isSymbol to eol (marco-ippolito) #52744
  • [832a77c003] - (SEMVER-MAJOR) util: move util.isString to eol (marco-ippolito) #52744
  • [708f57ea49] - (SEMVER-MAJOR) util: move util.isNumber to eol (marco-ippolito) #52744
  • [6ec403fe91] - (SEMVER-MAJOR) util: move util.isNullOrUndefined to eol (marco-ippolito) #52744
  • [7cd8bb26d1] - (SEMVER-MAJOR) util: move util.isNull to eol (marco-ippolito) #52744
  • [e32b0c1eab] - (SEMVER-MAJOR) util: move util.isBuffer to eol (marco-ippolito) #52744
  • [be528ab11e] - (SEMVER-MAJOR) util: move util.isBoolean to eol (marco-ippolito) #52744
  • [ac97a532f5] - (SEMVER-MAJOR) util: move util._extend to eol (marco-ippolito) #52744
  • [e225f00034] - (SEMVER-MAJOR) zlib: remove zlib.bytesRead (Yagiz Nizipli) #55020

Semver-Minor Commits

  • [90e3e5e173] - (SEMVER-MINOR) crypto: add KeyObject.prototype.toCryptoKey (Filip Skokan) #55262
  • [29f31c6a76] - (SEMVER-MINOR) crypto: add Date fields for validTo and validFrom (Andrew Moon) #54159
  • [83eb4f2855] - (SEMVER-MINOR) deps: V8: cherry-pick cd10ad7cdbe5 (Joyee Cheung) #52535
  • [6c6562ce8b] - (SEMVER-MINOR) http2: expose nghttp2_option_set_stream_reset_rate_limit as an option (Maël Nison) #54875
  • [d473606040] - (SEMVER-MINOR) lib: propagate aborted state to dependent signals before firing events (jazelly) #54826
  • [772b35bdc4] - (SEMVER-MINOR) module: support loading entrypoint as url (RedYetiDev) #54933
  • [06206af181] - (SEMVER-MINOR) module: unflag --experimental-require-module (Joyee Cheung) #55085
  • [0b9249e335] - (SEMVER-MINOR) module: implement the "module-sync" exports condition (Joyee Cheung) #54648
  • [62383cd113] - (SEMVER-MINOR) module: implement flushCompileCache() (Joyee Cheung) #54971
  • [4dfed556ba] - (SEMVER-MINOR) module: throw when invalid argument is passed to enableCompileCache() (Joyee Cheung) #54971
  • [9a73aa0d15] - (SEMVER-MINOR) module: write compile cache to temporary file and then rename it (Joyee Cheung) #54971
  • [92a25abca9] - (SEMVER-MINOR) path: add matchGlob method (Aviv Keller) #52881
  • [b0f025208f] - (SEMVER-MINOR) process: add process.features.require_module (Joyee Cheung) #55241
  • [bf11e5793b] - (SEMVER-MINOR) test_runner: support custom arguments in run() (Aviv Keller) #55126
  • [059e08bb21] - (SEMVER-MINOR) test_runner: add 'test:summary' event (Colin Ihrig) #54851
  • [f79fd03f41] - (SEMVER-MINOR) test_runner: add support for coverage via run() (Chemi Atlow) #53937
  • [d2ad9b4fb6] - (SEMVER-MINOR) worker: add markAsUncloneable api (Jason Zhang) #55234

Semver-Patch Commits