← All errors · VercelVercel build & deploy errors

Command "npm run build" exited with 1

Exact error

Error: Command "npm run build" exited with 1

What it means

Your build script failed on Vercel. This line is a summary; the real error is earlier in the build log.

Likely causes

How to fix it

  1. Scroll up in the Vercel build log to the first red error; that is the real cause.

  2. Reproduce locally with a clean install:

    rm -rf node_modules .next
    npm ci
    npm run build
  3. Fix type/lint errors shown. As a temporary escape hatch only, Next.js lets you skip them:

    // next.config.js
    module.exports = {
      eslint: { ignoreDuringBuilds: true },
      typescript: { ignoreBuildErrors: true },
    };
  4. Make sure all build-time env vars are set in Vercel project settings.

Prevent this next time

Guide: catch outages before your users do.

FAQ

What does "Command "npm run build" exited with 1" mean?

Your build script failed on Vercel. This line is a summary; the real error is earlier in the build log.

What usually causes it?

TypeScript or ESLint errors (Next.js fails the build on these by default). Missing environment variables used at build time. Case-sensitive import paths. Dependency differences between your machine and a clean install.

How do I fix it?

1. Scroll up in the Vercel build log to the first red error; that is the real cause. 2. Reproduce locally with a clean install: 3. Fix type/lint errors shown. As a temporary escape hatch only, Next.js lets you skip them: 4. Make sure all build-time env vars are set in Vercel project settings.

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy