"The engine node is incompatible": fix Node version mismatches on deploy
THE SHORT ANSWER
The error means the Node version running your install is outside a range in engines.node, either your own package.json or a dependency's. Yarn 1 stops on it by default; npm only warns unless engine-strict is on; pnpm warns for your project and fails for dependencies when engine-strict is set. Fix it by choosing the Node version on the build machine; loosening the check only hides the problem. Set engines.node to a bounded range such as "24.x", and check how your host reads it. Heroku and Vercel read engines.node, Render reads NODE_VERSION, .node-version and .nvmrc before it, and nixpacks reads NIXPACKS_NODE_VERSION before everything else and only knows whole majors. Run node -v in your build command to see what you actually got.
What does "The engine node is incompatible" mean?
A package declares the Node versions it supports in the engines field of its package.json. When the Node running the install doesn't match, the package manager complains. The wording depends on which one you use. These are real outputs from Node 20.20.2 installing a package that asks for "node": ">=24":
# yarn 1.22.22 (fails by default) error [email protected]: The engine "node" is incompatible with this module. Expected version ">=24". Got "20.20.2" error Found incompatible module. # npm 10.8.2 (warns, then installs anyway) npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: '[email protected]', npm warn EBADENGINE required: { node: '>=24' }, npm warn EBADENGINE current: { node: 'v20.20.2', npm: '10.8.2' } npm warn EBADENGINE } # npm with engine-strict=true in .npmrc (fails) npm error code EBADENGINE npm error engine Unsupported engine npm error notsup Required: {"node":">=24"} npm error notsup Actual: {"npm":"10.8.2","node":"v20.20.2"} # pnpm 10 with engine-strict=true (fails for a dependency) ERR_PNPM_UNSUPPORTED_ENGINE Unsupported environment (bad pnpm and/or Node.js version) Your Node version is incompatible with "file:../dep".
npm's docs call the field “advisory only”: it produces warnings unless engine-strict is set, and then npm “will stubbornly refuse to install”. So the same repo can install fine with npm on your laptop and fail with Yarn in CI, or the reverse if your repo has an .npmrc with engine-strict=true.
The warning is not always harmless when npm lets it through. A package with native bindings can skip the binary for your Node version and fail later in the build with a different error, such as “Cannot find native binding”. When a build breaks after an EBADENGINE warning, treat the warning as the cause.
Quick checklist
| What you see | Likely cause | Fix |
|---|---|---|
| Works locally, fails on the host | Your shell uses nvm, the host uses its own default | Set the version where the host reads it (table below) |
| A dependency is named in the error | You upgraded a package that dropped your Node version | Raise your Node version, or pin the older package |
Host ignores your .nvmrc | It reads engines.node or an env var first | Put the same version in engines.node |
| A new Node major appeared overnight | An open range like >=20 resolves to the newest release | Use a bounded range such as 24.x |
| Right major, still failing | A package needs a newer minor, like >=22.12 | Check node -v in the build log; move to the next major if the host only picks majors |
How do you set engines.node and .nvmrc?
Put the range in package.json. A major with .x is the safe default:
{
"engines": {
"node": "24.x"
}
}Avoid open-ended ranges. Heroku's docs advise against >= 26.x because it “could install a higher version of Node.js than intended”, and Render warns that “an unbounded range (such as >=20) always resolves to the latest release”. Your app then moves to a new major the day the platform adds it.
.nvmrc is for your own machine. nvm reads it when you run nvm use or nvm install without a version, searching up from the current directory. The file holds one version, such as 24 or lts/*. nvm doesn't read engines, so keep the two in agreement:
echo "24" > .nvmrc nvm install # installs and switches to Node 24 node -v
How does each platform pick the Node version?
Each host reads different files, in a different order:
| Platform | Reads, first match wins | Default |
|---|---|---|
| nixpacks | NIXPACKS_NODE_VERSION, engines.node, .nvmrc, .node-version | Node 18 |
| Heroku | engines.node (its docs describe no other file) | 26.x |
| Render | NODE_VERSION env var, .node-version, .nvmrc, engines.node | Depends on when the service was created; 24.22.1 for new ones |
| Vercel | engines.node, then the Node.js Version project setting | 26.x |
The details that cause surprises:
- nixpacks picks whole majors. Its Node provider takes the newest even major it knows (24 at most in v1.41) that overlaps your range, so
>=18becomes Node 24. A range it can't meet falls back to 18:>=26gives Node 18. An env var beatsengines.node, andengines.nodebeats.nvmrc. - Vercel offers only majors (26.x, 24.x and 22.x today), and
engines.nodeoverrides the project setting.>=22.0.0deploys the latest 26.x. - Render resolves ranges and aliases like
lts, and aNODE_VERSIONset in the dashboard beats every file in the repo. - Heroku accepts a major (
26.x), a minor (26.13) or an exact version, and recommends the major range so security releases arrive on their own.
Whatever the host, print the version at the start of the build. Add node -v && in front of your build command once, read the log, then remove it.
What happens on EthioDeploy?
Apps without a Dockerfile build with nixpacks, and EthioDeploy passes NIXPACKS_NODE_VERSION=22 so nothing lands on nixpacks' Node 18 default. For a Node-only project without its own nixpacks.toml, that resolves to Node 22.19, and the build log says:
Using Node 22.19 (newer nixpkgs archive than nixpacks' default 22.11).
Because that variable outranks engines.node inside nixpacks, the runner reads your engines.node first and decides whether to keep it:
- The range allows 22.19 (
>=18,>=20.9,^22,*, noenginesat all): you build on Node 22.19. Plain nixpacks would turn>=18into Node 24; here it stays on 22. - The range rules out 22.19 and nixpacks can meet it (
24,24.x,^24,>=24,>=22.23.4): the floor is dropped, nixpacks resolves the range on its own, and you get Node 24. The log says:
Using Node 24 from package.json engines.node (">=24").- The range rules out 22.19 but nixpacks has nothing newer to offer (
^22.20, which nixpacks maps back to 22, or>=26, which it maps to 18): you build on Node 22, and the log tells you so:
package.json engines.node is "^22.20", which nixpacks can't provide; building on Node 22. Set NIXPACKS_NODE_VERSION (e.g. 24) to choose a version.
To choose the version yourself, add NIXPACKS_NODE_VERSION (for example 24) under Environment Variables and leave “Runtime only” off, so the build sees it. Project variables come after the platform's own flag, so yours wins. Node 24 currently resolves to 24.10, so a package that needs a later 24 minor still won't install; nixpacks picks majors, not minors.
.nvmrc and .node-version don't change the version here, because NIXPACKS_NODE_VERSION is read before them. Use engines.node or the env var. With your own Dockerfile none of this applies: the FROM line picks Node. More in Deploy a Node.js app, and for a different install failure see npm ERESOLVE peer dependency errors.
Questions
Yarn 1 printed it because a package's engines.node range doesn't include the Node version running the install. Yarn 1 stops on it by default. Install a Node version inside the range, or pass --ignore-engines only if you're sure the package works on your version.
npm treats engines as advisory unless engine-strict is true, in .npmrc or on the command line. With engine-strict on, the same mismatch is an error and npm refuses to install.
Render does, after the NODE_VERSION env var and .node-version and before engines.node. Vercel uses engines.node and the project setting. Heroku's Node.js docs describe only engines.node. Putting the same major in engines.node works on all three.
Use a bounded range like 20.x or 24.x. Hosts resolve an open range like >=20 to the newest Node they have, so a new major can reach production without a code change.
Set engines.node to a range that rules out Node 22, such as "24.x" or ">=24", or add the env var NIXPACKS_NODE_VERSION=24 with Runtime only off. Then redeploy. The build log names the Node version it chose.
Sources
Checked on November 24, 2026:
Push a repo. Get a URL.
Start freeJoin the EthioDeploy Telegram
Release notes as they ship, plus deploy help from the team and other developers.