Increase Node.js engine version
Recipe ID
org.openrewrite.node.migrate.increase-node-engine-versionArtifact@openrewrite/recipes-nodejsRaises the lower bound of the engines.node version range in package.json to the specified Node.js version, performing a hard cutover that drops support for older, end-of-life versions (22.x → 24.x, >= 22 → >= 24). The original constraint style is preserved where possible and the version is never lowered.
Single recipeProprietary
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.node.migrate.increase-node-engine-version --recipe-option "version=22"If the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-nodejsOptions
| Name | Type | Description |
|---|---|---|
versionrequired | | The Node.js major version to allow, e.g. 20 or 22. e.g. 22 |