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

URL: https://antideploy.com/blog/sh-command-not-found-during-the-build

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.

**What you see**

```
> my-app@0.0.0 build
> vite build

sh: 1: vite: not found
```

## At a glance

- **What it means**: A command was not found
- **If it is an npm package**: Add it to package.json, commit the lock file
- **If it is a system program**: Use a Dockerfile
- **Where it fails**: In the build step

Published 7 October 2026. Facts checked 7 October 2026. 2 min read.

## 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](https://antideploy.com/blog/how-to-deploy-a-docker-app-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.

## Command-not-found questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto: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.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [How to deploy a Docker app with your own Dockerfile](https://antideploy.com/blog/how-to-deploy-a-docker-app-with-your-own-dockerfile): Where the Dockerfile must be, how the port is read, the account rule and the RUN --mount limit.
- [npm ci can only install packages when your package.json and package-lock.json are in sync](https://antideploy.com/blog/npm-ci-can-only-install-packages-when-package-json-and-package-lock-json-are-in-sync): The lock file does not match package.json. Run npm install and commit the lock file.
- [Error: Cannot find module when the app starts](https://antideploy.com/blog/error-cannot-find-module-when-the-app-starts): The start command needs a package that was removed with the dev dependencies after the build.

- [Deployments](https://antideploy.com/platform/deployments)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)
- [Hosting](https://antideploy.com/platform/hosting)

Facts on this page were checked against the live platform on 7 October 2026.

## 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.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
