Cloudflare Pages: Build failed — Node.js version not supported / npm ERR! (build command exited with code 1)
The Pages build environment could not build the project.
Cloudflare Pages build failedBuild failed Node.js versionFailed: build command exited with code: 1pages build error Meaning
Pages uses a fixed default Node version and package manager. A framework needing newer Node, a missing lockfile, or env variables set only locally make builds fail even when they work locally.
Common causes
- Node version too old for the framework
- Environment variables missing in Pages settings
- Wrong build command or output directory
- Lockfile mismatch (npm vs pnpm vs yarn)
⚡ Quick fix
- Set
NODE_VERSION(andPNPM_VERSION) as environment variables - Add production env vars in the dashboard
- Match the build command and output directory to the framework
Detailed fix by platform
Pages settings
- Environment variables →
NODE_VERSION = 20; Build commandnpm run build; Outputdist
How to diagnose
- Log — First error line?
- Node — Version?
- Env — Variables set?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Cloudflare
Other ways to find it
Where this error sits
Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 2 Dec 2026