Vercel build failed
Command "npm run build" exited with 1
Your build command failed on Vercel's build machine, so nothing new was deployed.
Before you start: is Vercel itself down?
What it means
Every deploy, Vercel runs your project's build command on its own machine. npm run build is the usual one. Exit code 1 means that command failed. The line that says so only tells you that it failed; the reason is further up the build log.
Vercel's troubleshooting guide says the same: open the build logs, find the error, and read a few lines above the last one, because the last line is often not the cause.
Common causes
- The code does not build. A type error, a syntax error, or an import that cannot be found (see Module not found). These fail on your own computer too, which is why Vercel suggests running
npm run buildlocally first. - It builds on your computer but not on Vercel. Something differs between the two: an environment variable that is set locally but not in the Vercel project, or a file name whose capital letters do not match the import. Vercel builds on Linux, where
Button.tsxandbutton.tsxare different files. - The build ran out of memory or time. Vercel's guide gives the limits: 8192 MB of memory and 45 minutes per build.
- There is no build log at all. Vercel's guide lists an invalid
vercel.jsonamong the reasons a log can be missing.
A prompt to fix it
Paste it into your AI coding tool and fill in the parts in angle brackets. It asks the tool to find the cause and show you before it changes anything.
My Vercel deploy fails with: Command "npm run build" exited with 1.
Here is the build log, from the first line that mentions an error down to the end:
<paste it>
Before you change anything:
1. Point to the first line in that log that is an actual error. Not the last line: the last line only says the build failed.
2. Run npm run build on this machine and tell me whether it fails with the same error.
3. Tell me which file and line cause it, and why.
Then fix that one error with the smallest change you can. Do not upgrade packages, change build settings, or touch files that are not involved. Run npm run build again and show me the end of the output.How to check it is fixed
npm run buildfinishes on your own computer without an error.- After you push, the new deployment's build log ends without an error and the deployment is marked Ready.
- If it still fails, compare the first error line with the one you fixed. A different error means the fix worked and the build got further.
Tested prompts that help
- Hand It An Error — If the fix above does not do it, or your error is close to this one but not quite, this prompt hands your AI tool the whole error, what you expected, the last thing you changed and what you already ruled out, and makes it name the cause before it changes anything. Test log: Pass, ChatGPT (Pro), September 27, 2026; Pass, Claude.ai (Fable 5.1 Max), September 27, 2026.
- Verify The Imports — If the build log names a package or import the AI added, this prompt makes it prove each one exists and works in the version you have installed, before anything gets installed or rewritten. Test log: Partial, ChatGPT (Pro), September 27, 2026.
Sources
Everything above comes from these pages. We read them on September 27, 2026; if one has changed since, it wins.