#14 most commondeployLovableBolt.newCursorReplitv0Windsurf
Deploy fails: Command "npm run build" exited with 1
Error: Command "npm run build" exited with 1 / Build failed due to a user error: Build script returned non-zero exit code: 2
Got a slightly different error? Paste the exact message and get a fix prompt tailored to it.
Paste your error →What it means
The hosting service tried to package your app and hit an error partway through. The real reason is a few lines above this message in the build log.
How to fix it: paste this prompt into your AI builder
Fix prompt for Lovable, Bolt, Cursor, Replit, v0, Windsurf
My deploy fails with "npm run build exited with 1". Here is the full build log (I'll paste the lines above the failure). Find the FIRST real error in the log, explain it simply, and fix that root cause (missing dependency, TypeScript error, file casing mismatch, missing env var at build time, or wrong Node version). Run npm run build locally to confirm it passes. Don't change unrelated code.
If the AI can't fix it: manual steps
- Scroll up in the build log to the first line containing 'error' and paste that into the box above instead; it will match a more specific fix.
- Check that environment variables are set in the host's Production settings, then redeploy.
Where this happens
Seen in these AI app builders and editors:
LovableBolt.newCursorReplitv0Windsurf
Sources
Related deploy errors
Still stuck? Paste your full error and UnstuckMyVibe will match it and hand you the exact fix prompt.
Fix my error →