🔥 All-Access Pass — $199 USD (Regular $499) · Unlock all 2,836 Astro themes ➔
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Deployment••By Komal Nakrani

Astro Node Version: Which Node.js Astro 7 Needs

The Astro Node version you need: Node.js 22.23.4 or newer for current Astro 7 releases. Requirements by release, how to check, and how to pin it in CI and hosts.

#Astro#Deployment#Node.js#Astro Node Version

Current Astro releases (7.4.2 and later) need Node.js 22.23.4 or newer. Earlier Astro 7 releases accept slightly older Node 22 versions, and Node.js 24 works with all of them. Check yours with node -v, then pin the same version in .nvmrc, your package.json engines field, and your host’s build settings so local builds and deploys match.

Key Takeaways

  • Astro 7.4.2+ requires Node.js 22.23.4 or newer; the requirement is in the engines field of Astro’s package.json.
  • Too old a Node version makes the astro command stop with a “not supported” message before it does anything.
  • Pin one version in .nvmrc and reuse it in CI with node-version-file.
  • Hosts pick their own default Node version; set it explicitly.

Requirements by Astro release

The minimum comes from the engines.node field Astro publishes:

Astro version Minimum Node.js
7.0 to 7.3 22.12.0
7.4.0 to 7.4.1 22.22.0
7.4.2 and later 22.23.4

To see what your installed Astro asks for, read it from the package:

# Terminal
npm view astro engines           # latest published release
node -p "require('astro/package.json').engines"   # the version in your project
node -v                          # what you are running

Astro’s CLI checks this before running any command. On an unsupported Node.js it prints an error naming your version and the supported range, with a link to setup instructions for Netlify, Vercel or GitHub Actions when it detects one of them. Our installation docs list the other requirements for running one of our Astro themes.

Upgrade Node.js locally

Use a version manager so different projects can use different versions:

# Terminal (nvm)
nvm install 22
nvm use 22
node -v

nvm install 22 installs the newest Node.js 22 release. fnm and Volta work the same way. If you install from nodejs.org instead, choose the current LTS release.

Pin the version in the project

Write the version once and reference it everywhere:

# .nvmrc
22
{
  "engines": {
    "node": ">=22.23.4"
  }
}

The engines field goes in your own package.json. npm warns when it is not met; set engine-strict=true in .npmrc to make that an error. nvm use and many hosts read .nvmrc automatically.

Set it in CI and on your host

GitHub Actions can read the same file:

# .github/workflows/deploy.yml (excerpt)
- uses: actions/setup-node@v4
  with:
    node-version-file: .nvmrc
    cache: npm

On hosts, set it explicitly rather than trusting the default:

Host How to set Node.js
Netlify Reads .nvmrc, or set NODE_VERSION in environment variables
Cloudflare Pages Reads .nvmrc, or set NODE_VERSION in environment variables
Vercel Project Settings, Build and Deployment, Node.js Version, or engines.node
GitHub Pages (Actions) actions/setup-node as above

A build that works locally and fails on the host with a Node error almost always means the host is on an older default. The Cloudflare Pages deploy docs show where the setting lives there.

Server-rendered sites

With an adapter, Node.js also matters at runtime. The Node adapter runs your server on whatever Node.js the machine has, so match it to your build. Serverless adapters run on the platform’s runtime; pick a Node 22 or 24 runtime in its settings. Edge runtimes such as Cloudflare Workers do not use Node.js versions at all, but the build still does.

Upgrading Astro and Node together

When you move to a new Astro minor or major version, check its engines field before you deploy. The official upgrade guide lists breaking changes, and our guide to upgrading Astro major versions covers the order to do things in.

FAQ

What Node.js version does Astro 7 need?

Current Astro 7 releases need Node.js 22.23.4 or newer. Astro 7.0 to 7.3 accepted Node.js 22.12.0 or newer. Node.js 24 satisfies every Astro 7 release.

Does Astro work with Node.js 20?

Not Astro 7. Node.js 20 is below the minimum for every Astro 7 release, so the CLI stops before building. Stay on an older Astro major or upgrade Node.js.

Can I use Bun or Deno instead of Node.js with Astro?

Bun and Deno can run many Astro projects, but Astro’s supported runtime is Node.js and its version checks are written for it. Use Node.js for production builds unless you have tested the alternative.

Why does my Astro build fail on Netlify or Vercel but not locally?

The host is usually building with a different Node.js version. Add an .nvmrc file or set the Node.js version in the project settings to match your local version.