← All recipes
Moderne licensed

Increase Node.js engine version

Recipe IDorg.openrewrite.node.migrate.increase-node-engine-versionArtifact@openrewrite/recipes-nodejs

Raises 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.x24.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-nodejs

Options

NameTypeDescription
versionrequiredThe Node.js major version to allow, e.g. 20 or 22.
e.g. 22