sh: vite: command not found (npm script)
A tool used in an npm script isn’t installed in node_modules/.bin.
command not foundis not recognized as an internal or external command 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
- npm install (including dev deps)
- Add the tool: npm i -D vite
- In Docker builds, install dev deps for the build stage
Detailed fix by platform
npm
npm ci --include=dev && npm run build
How to diagnose
- Installed — node_modules/.bin/tool exists?
- Env — NODE_ENV=production during install?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in npm
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026