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
-
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,eslintandprismaare npm packages. Names likeffmpeg,convertandpythonare system programs. -
If it is an npm package, add it to
package.jsonRun
npm install --save-dev vitefor a build tool, ornpm install viteif the app needs it when it runs. Commitpackage.jsonand the lock file, then deploy again. -
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.jsondoes not list it. -
An agent ran a command with
npxonce. The command worked, but the package was never saved topackage.json. -
The build runs in the wrong folder. The
package.jsonwith the dependency is in a subfolder of what was sent.