Upgrade to Node.js 22
ProprietaryMigrate deprecated APIs for Node.js 22 compatibility. Includes all migrations from Node.js 20, plus Node 21 and Node 22 deprecations.
org. openrewrite. node. migrate. upgrade-node-22mod run . --recipe= org. openrewrite. node. migrate. upgrade-node-22Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Increase Node.js engine version
- Increase Node.js version in GitHub Actions
- org.openrewrite.nodejs.migrate.UpgradeNodeVersion
- Upgrade to Node.js 20
- Replace deprecated
util.types.isWebAssemblyCompiledModule() - Find deprecated
punycodemodule usage - Find deprecated
crypto.createCipher()andcrypto.createDecipher()usage - Replace deprecated
util.isX()methods with native JavaScript - Replace deprecated
util._extend()withObject.assign() - Replace deprecated
new crypto.Hash()andnew crypto.Hmac()with factory methods - Replace deprecated
Buffer.slice()withBuffer.subarray() - Remove usage of deprecated
process.features.tls_*properties - Remove unnecessary
util.promisify()on Promise-returning functions