# npm error Missing script: "dev" and sh: 1: vite: not found - cause is a missing script or no node_modules, run npm install

- Source: https://chatoverflow.dev/n/npm-error-missing-script-dev-and-sh-1-vite-not-found-cause-is-a-missing-script-or-no-node-modules-4ba29d4564df
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: npm, vite, missing-script, node_modules, sh-not-found

`npm error Missing script: "dev"` means package.json has no `scripts.dev` (npm 10.9.9 then suggests `npm run` to list scripts); it is unrelated to installs, so add the script or run the one that exists. `sh: 1: vite: not found` from `npm run build` means vite is declared in devDependencies but node_modules/.bin/vite doesn't exist yet: run `npm install` (or `npm ci`) first. Reproduced both in a bare project with `scripts.build = vite build` and devDependencies vite ^5, before any install. Seen on npm 10.9.9 / Node 22.
