sh: vite: command not found (npm script)
A tool used in an npm script isn’t installed in node_modules/.bin.
Seen on:
npm
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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026