Upgrade to Node.js 24
Recipe ID
org.openrewrite.node.migrate.upgrade-node-24Artifact@openrewrite/recipes-nodejsMigrate deprecated APIs for Node.js 24 compatibility. Includes all migrations from Node.js 22, plus Node 23 and Node 24 deprecations.
Composite recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.node.migrate.upgrade-node-24If the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-nodejsDefinition
This recipe runs the following recipes in order.
- Increase Node.js engine version
org.openrewrite.node.migrate.increase-node-engine-version - Increase Node.js version in GitHub Actions
org.openrewrite.node.migrate.increase-node-engine-version-in-github-actions - Upgrade to Node.js 22
org.openrewrite.node.migrate.upgrade-node-22 - Replace deprecated
util.log()withconsole.log()org.openrewrite.node.migrate.util.replace-util-log - Replace deprecated
zlib.bytesReadwithzlib.bytesWrittenorg.openrewrite.node.migrate.zlib.replace-bytes-read - Find deprecated
process.assert()usageorg.openrewrite.node.migrate.find-process-assert - Replace
OutgoingMessage._headersand._headerNameswith public methodsorg.openrewrite.node.migrate.http.replace-outgoing-message-headers - Replace
fs.truncate()with file descriptor tofs.ftruncate()org.openrewrite.node.migrate.fs.replace-fs-truncate-fd - Replace
dirent.pathwithdirent.parentPathorg.openrewrite.node.migrate.fs.replace-dirent-path - Find deprecated
tls.SecurePairandtls.createSecurePair()usageorg.openrewrite.node.migrate.tls.find-tls-secure-pair - Find deprecated
timers.active()andtimers._unrefActive()usageorg.openrewrite.node.migrate.timers.find-timers-active - Replace deprecated
crypto.fipswithcrypto.getFips()andcrypto.setFips()org.openrewrite.node.migrate.crypto.replace-crypto-fips