script command not found 📦 npm

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

  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?

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