Vercel: Error: Command "npm run build" exited with 1
The Vercel build step failed; the real reason is printed in the build log above this line.
Error: Command "npm run build" exited with 1Command "npm run build" exited with 1Error: Command "yarn build" exited with 1Error: Command "pnpm run build" exited with 1Build Failed Command "next build" exited with 1 Meaning
Scroll up to the first error: type errors, lint errors, missing env vars at build, module not found (case-sensitivity), Node version differences, or memory limits. Reproduce locally with vercel build or npm run build using the same Node version (set in Project Settings or engines).
Common causes
- Type/lint errors only enforced in CI
- Missing environment variables
- Case-sensitive import paths (macOS vs Linux)
- Node version mismatch
- Out-of-memory in the build
⚡ Quick fix
- Read the build log above the error
- Run
vercel pull && vercel buildlocally - Match Node version via
engines.nodeor Project Settings
Detailed fix by platform
Linux
npx vercel pull --yes && npx vercel build
How to diagnose
- Log — First error line?
- Env — Present at build?
- Node — Same version?
🔧 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
- [Vue warn]: Component is missing template or render function Vue: [Vue warn]: Component is missing template or render function.
- Component provided template option but runtime compilation is not supported Vue: [Vue warn]: Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js"
- Could not find a production build in the '.next' directory Next.js: Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server
Most viewed in Next.js
- NEXT_REDIRECT Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch)
- server-only Next.js: You're importing a component that needs "server-only". That only works in a Server Component
- cookies() should be awaited Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value
Other ways to find it
Where this error sits
Origin: On your device. 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 5 Nov 2026