Blognpm

npm error Missing script: "build" How to fix it.

A step ran npm run build, and package.json has no build script. Add one, or stop calling it.

How the Agent API works
What you see
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error   npm run
  • What it meansThe script is not defined
  • Fix oneAdd the script
  • Fix twoRemove the call
  • Static sitesA build script is required

What it means

A command in the build ran npm run build. npm looked in package.json for a script named build and found none. The build says it in one sentence: package.json has no such script, but the build needs one.

How to fix it

Add the script. Put a build script in package.json that builds your project, for example "build": "vite build" or "build": "tsc".

Or remove the call. If your project needs no build, find the command that runs npm run build and remove it.

package.json
{
  "scripts": {
    "build": "vite build",
    "start": "node server.js"
  }
}

Static sites

A frontend that builds to files, such as Vite, Create React App, Astro or Gatsby, needs a build script. Without one there is no output folder to serve, and Antideploy tells you so. See how to deploy a Vite React app.

01Questions

Script questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Do server apps need a build script?

Only if they have a build step, such as compiling TypeScript. A plain Node app with a start script does not.

Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

What should the build script do?

It should compile or bundle your project and then exit. For Vite it is vite build, for TypeScript it is tsc, and for Next.js it is next build.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.