BlogBuild

sh: 1: vite: not found How to fix it.

The build tried to run a program that is not in the build image. If it is an npm package, add it to package.json. If it is a system program, use a Dockerfile.

How the Agent API works
What you see
> my-app@0.0.0 build
> vite build

sh: 1: vite: not found
  • What it meansA command was not found
  • If it is an npm packageAdd it to package.json, commit the lock file
  • If it is a system programUse a Dockerfile
  • Where it failsIn the build step

What it means

Your build runs commands from package.json, such as vite build or tsc. The shell looked for the program vite and could not find it. The build says the same thing in one sentence: the build tried to run a command and it is not installed in the build image. The name in the message can be vite, tsc, next, prisma or any other command.

How to fix it

  1. Decide what kind of program it is

    Ask your agent: "Is the missing command an npm package, or a system program?" Names like vite, tsc, next, eslint and prisma are npm packages. Names like ffmpeg, convert and python are system programs.

  2. If it is an npm package, add it to package.json

    Run npm install --save-dev vite for a build tool, or npm install vite if the app needs it when it runs. Commit package.json and the lock file, then deploy again.

  3. If it is a system program, use a Dockerfile

    The standard build image does not include extra system programs. A Dockerfile can install them. See how to deploy with your own Dockerfile.

Why it happens

  • The package is installed globally on your computer. It works there, and the project's package.json does not list it.
  • An agent ran a command with npx once. The command worked, but the package was never saved to package.json.
  • The build runs in the wrong folder. The package.json with the dependency is in a subfolder of what was sent.

01Questions

Command-not-found questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Why does it work on my machine?

Your machine has tools installed that the project never listed. A clean server has only what package.json and the lock file say.

Is a tool in devDependencies available during the build?

Build tools kept in devDependencies are installed for the build. They are removed from the final image afterwards, so a tool that your start command needs belongs in dependencies.

Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

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.