npm ERR! Missing script: "start" — how to fix
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
Quick fix: Run npm run to list the available scripts, then use the right one (Vite/Next projects use npm run dev). Make sure you're in the folder that contains the project's package.json (ls package.json). Or add the script: "scripts": { "start": "node index.js" }.
What it means
npm start is shorthand for npm run start. npm reads package.json in the current directory and looks for scripts.start. If it's missing, npm stops with this error and suggests similarly named commands (the npm star hint is just fuzzy matching — ignore it). Newer npm prints npm error Missing script: "start".
See what's actually available:
pwd
npm run # lists every script in this package.json
cat package.json
Cause 1: the project uses a different script name
Most modern templates don't define start for development:
| Project | Dev command |
|---|---|
| Vite (React, Vue, Svelte) | npm run dev |
| Next.js | npm run dev (npm start only serves a production build) |
| Create React App | npm start |
| Angular CLI | npm start (runs ng serve) |
| Vue CLI | npm run serve |
| Nuxt / Astro / SvelteKit | npm run dev |
So for Vite: npm run dev. Only start, test, stop and restart can be run without run; everything else needs npm run <name>.
Cause 2: wrong directory
If you cloned a repo with frontend/ and backend/ folders, the root package.json may have no scripts (or not exist — then you get ENOENT ... package.json). Change into the right folder:
cd frontend
npm install
npm run dev
In monorepos with workspaces, run it from the root with npm run dev --workspace=frontend (or -w frontend).
Cause 3: package.json has no start script (Node apps)
A plain Node project created with npm init -y only has a test script. Add one:
{
"scripts": {
"start": "node index.js",
"dev": "node --watch index.js"
}
}
Use the file that's really your entry point (server.js, app.js, dist/index.js...). If there's no scripts.start but a server.js exists in the folder, npm runs node server.js by default — so this error also means there's no server.js.
You can add scripts from the command line too:
npm pkg set scripts.start="node index.js"
Cause 4: deployment platform runs npm start
Heroku, Render, Railway, Azure App Service and many Docker images run npm start by default. Make sure start launches the production server and isn't a dev server:
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
}
For a static frontend (Vite/CRA build output) you usually don't need npm start at all — serve the dist/ or build/ folder as static files, or configure the platform's start command explicitly.
Cause 5: invalid or duplicated package.json
If scripts appears twice, the later one wins and the first is silently ignored. If the JSON is broken, npm reports EJSONPARSE instead. Check it with the JSON formatter or node -e "require('./package.json')".
Last updated 2026-11-19.