# sh: vite: command not found (npm script)

**Code:** `script command not found` · **Category:** npm · **Seen on:** npm

A tool used in an npm script isn’t installed in node_modules/.bin.

## Meaning

Dev dependencies weren’t installed (NODE_ENV=production / --omit=dev), node_modules is missing, or the tool was never added to package.json.

## Common causes

- npm install not run
- Dev dependencies skipped (--production, NODE_ENV=production)
- Tool not listed in package.json

## Quick fix

1. npm install (including dev deps)
2. Add the tool: npm i -D vite
3. In Docker builds, install dev deps for the build stage

## Detailed fix by platform

### npm

1. `npm ci --include=dev && npm run build`

## How to diagnose

1. **Installed** — node_modules/.bin/tool exists?
2. **Env** — NODE_ENV=production during install?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/sh-command-not-found-in-npm-script)
