Fixes · Deploys that break

Missing script: build (npm ERR! when the host builds your app)

The deploy stops at once with npm's 'Missing script: "build"' when package.json doesn't say how to build the app. One line in package.json fixes it.

What you see

The host's build log ends with npm ERR! Missing script: "build", or the host deploys an empty or unbuilt app.

Why it happens

Hosts run npm run build (or the same with pnpm, yarn or bun). Apps exported from AI tools, or started from a bare template, sometimes have only a dev script, or none.

How to fix it

  1. Add the framework's build command to the scripts in package.json: "build": "next build" for Next.js, "build": "vite build" for Vite, "build": "tsc" for a TypeScript server.
  2. Run npm run build on your computer and fix anything it reports before you deploy again.
  3. If the app needs no build (plain HTML), tell the host so: set its output directory to the folder with your index.html.

Or ask your AI tool to fix it

Paste this into Lovable, Bolt, v0, Replit or Cursor, and let it make the change.

Request for your AI tool
Add a build script to package.json that builds this app for production with its framework's own command, run it, and fix any errors it reports.

Don't change what the app does.
Never put a secret key or password in the code: read it from an environment variable.
If a step has to be done outside the code, like revoking a key in a provider's dashboard, list it for me at the end instead of skipping it.

How Launchpad helps

The launch check flags a missing build script before you deploy. When a deploy fails anyway, the console explains the failure in plain words, with a request to paste into your AI tool.

Check your app for this, freeStart free

Related