Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Vercel builds with the wrong Node.js version

ErrorThe build runs a different Node.js major than the one on your machine

Short answer

Vercel only offers major versions of Node.js (22.x, 24.x and 26.x today). The version comes from the Node.js Version setting in the project, and a valid engines.node range in package.json overrides it. A mismatch is usually an engines range that points at another major, or a framework that needs a newer one.

  • Applies to Vercel, Node.js 22, Node.js 24, Next.js 16
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the version the build really uses. Put node -v in the Build Command, or log process.version inside a function, then compare it with your settings.

    node -v && npm run build
  2. 2Match what you see, then jump to its fix

    1. 1The dashboard says 24.x but the build log shows another major.engines.node in package.json overrides the project settingFix
    2. 2You asked for a version such as 18.x or 20.x, or a fixed minor like 22.3.0, and the build runs something else.The wanted major is not one Vercel offersFix
    3. 3Install or build fails after you upgraded Next.js, while the same code ran before.The framework needs a newer Node.js than the one selectedFix

What does the error look like?

  • The build runs a different Node.js major than the one on your machine
  • Dependencies or Next.js refuse to install or start because Node.js is too old
  • Changing the Node.js Version in project settings has no effect on new deployments

Cause 1 of 3

engines.node in package.json overrides the project setting

1Check

A valid semver range in engines.node takes precedence over the Node.js Version setting in the project. Read it.

node -p "require('./package.json').engines"

2Fix

Change the range to the major you want, or delete the engines field and let the project setting decide.

{
  "engines": {
    "node": "24.x"
  }
}

3Verify

Redeploy and read the version printed by node -v in the build log.

git commit -am "set node 24.x" && git push

Confirmed by vercel.com

Did this fix it?

Cause 2 of 3

The wanted major is not one Vercel offers

1Check

The documented versions are 26.x (default), 24.x and 22.x, and only major versions are selectable; Vercel rolls minor and patch updates out itself. The docs also announce Node.js 20 being deprecated on October 1, 2026.

node -p "require('./package.json').engines?.node"

2Fix

Pick one of the listed majors, in package.json or in Settings, Build and Deployment, Node.js Version.

{
  "engines": {
    "node": "22.x"
  }
}

3Verify

Redeploy and check node -v in the build log.

git commit -am "use a supported node major" && git push

Confirmed by vercel.com

Did this fix it?

Cause 3 of 3

The framework needs a newer Node.js than the one selected

1Check

Next.js 16 raises the minimum to Node.js 20.9.0 and drops Node.js 18. Compare the framework's requirement with the version in the build log.

npx next --version && node -v

2Fix

Select a Node.js major that meets the requirement, such as 22.x or 24.x, then redeploy.

{
  "engines": {
    "node": "24.x"
  }
}

3Verify

The build finishes and the deployment serves the page.

curl -I https://your-project.vercel.app

Confirmed by nextjs.org

Did this fix it?

How do I stop it coming back?

  • Keep engines.node, your local Node.js and the Vercel setting on the same major, and write the major down in an .nvmrc or the README.
  • Use a range like 24.x, not an exact version, because only majors can be chosen.
  • Read the Vercel changelog entry when a major is deprecated, and move before the date.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.