npm ERR! Missing Script: Start— Fixed [Complete Guide 2026]
⚡ Quickest Fix — 60 seconds
Open your package.json and add a start script. Pick the right command for your framework:
{
"scripts": {
"start": "node index.js" // Plain Node.js
"start": "next start" // Next.js (production)
"start": "react-scripts start" // Create React App
"start": "vite preview" // Vite
"start": "node server.js" // Express
}
}Save the file, then run npm start again. Done.
Not sure which one applies to you? The full breakdown — including why this happens, every possible cause, and framework-specific fixes — is below.
What Does "npm ERR! Missing Script: Start" Mean?
Here is the exact error:
npm ERR! Missing script: "start"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm runWhen you run npm start, npm looks inside your package.json for a scripts section and within it a key called start. If that key does not exist — for any reason — npm has no command to run and throws this error immediately.
It is a configuration error, not a code error. Your application code is fine. The problem is that npm does not know how to start it.
Every Possible Cause
- The scripts section in package.json has no "start" key
- You are in the wrong directory — the package.json here belongs to a different project
- You cloned a project that uses npm run dev instead of npm start
- Your package.json was accidentally emptied, overwritten, or corrupted
- The "start" key was renamed (to "dev", "serve", "launch", etc.) during development
- You are running npm start on a library package — not an app — which has no start command
- A deployment pipeline created a stripped package.json without the scripts section
Add a "start" Script to package.json
Most common fixThe direct fix is always the same: open package.json and add a start script. The value is whatever command your app uses to run.
How package.json scripts work
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"start": "node index.js",
"dev": "node --watch index.js",
"build": "tsc",
"test": "jest"
}
}The scripts object maps script names to shell commands. When you run npm start, npm runs whatever string is in the start field as a shell command in your project directory.
View what scripts are currently defined
Before editing, run this to see all scripts your project currently has:
npm runIf the output shows dev but no start — you probably need npm run dev, not npm start. See Fix 6.
npm start is shorthand — it is the only script name (along with test, stop, and restart) you can run without the 'run' keyword. All other scripts need 'npm run scriptname'.
You Are in the Wrong Directory
Very common — check this earlyIf you typed npm start in a folder that contains a package.json from a different project — one without a start script — you will get this exact error. Especially common when working across multiple projects or after opening a new terminal window.
# Check where you are
pwd # macOS/Linux
cd # Windows
# Check what package.json is here
cat package.json
# Navigate to your actual project
cd ~/projects/my-app
npm startRun 'npm run' with no arguments — it lists every script defined in the local package.json. If 'start' is not in that list, you have the wrong package.json, a missing script, or both.
Start Scripts by Framework
Next.js · React · Express · Vite · moreEach framework uses a slightly different start command. Here is the correct start script for every major framework:
Next.js
Next.js requires a build before you can run npm start. The 'next start' command serves the production build — it will fail with a different error if you have not run 'npm run build' first.
{
"scripts": {
"dev": "next dev", // development
"build": "next build", // create production build
"start": "next start", // serve production build
"lint": "next lint"
}
}Create React App
{
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test"
}
}Vite (React, Vue, Svelte)
Vite uses dev for development and preview to preview the production build — it has no start script by default. If your team uses npm start, add one:
{
"scripts": {
"dev": "vite", // development
"build": "vite build",
"preview": "vite preview",
"start": "vite" // add this if you want npm start to work
}
}Express / Plain Node.js
{
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js" // hot reload in development
}
}NestJS
{
"scripts": {
"start": "nest start",
"start:dev": "nest start --watch",
"start:prod": "node dist/main"
}
}Astro
{
"scripts": {
"dev": "astro dev",
"start": "astro dev", // alias so npm start works
"build": "astro build",
"preview": "astro preview"
}
}Angular
{
"scripts": {
"start": "ng serve",
"build": "ng build",
"test": "ng test"
}
}package.json Is Corrupted, Empty, or Missing
After bad merges or manual editsIf your package.json was accidentally emptied during a git merge conflict, manually broken during editing, or simply does not exist — npm will throw the missing script error because it cannot read a valid scripts section.
Check if package.json is valid JSON
# macOS / Linux
cat package.json
# Validate JSON syntax
node -e "require('./package.json')" && echo "Valid JSON" || echo "Invalid JSON"If package.json has merge conflict markers
After a git merge, package.json sometimes contains conflict markers that break JSON syntax:
<<<<<<< HEAD
"start": "node index.js",
=======
"start": "node server.js",
>>>>>>> feature-branchOpen the file, resolve the conflict by keeping the correct version, delete the conflict markers, and save. Then verify it is valid JSON:
node -e "require('./package.json')" && echo 'Valid'If package.json is genuinely missing
npm init -y
# Then manually add your scripts sectionAlways use a JSON validator or your editor's built-in JSON linting after manually editing package.json. A single misplaced comma or missing quote will silently break the entire file.
Run Node Directly Without a Start Script
Quick workaroundIf you just need to run your app immediately and do not want to edit package.json right now, you can bypass npm scripts entirely and run Node directly:
# Run your entry point file directly
node index.js
node server.js
node app.js
node src/index.jsThis is fine as a temporary workaround but adding a proper start script to package.json is always better for the long term — it documents how to run the app for your whole team and integrates with deployment pipelines that call npm start.
Or use npx for framework CLIs
npx next dev
npx vite
npx astro devWrong Script Name — Use "npm run dev" Instead
Vite, Next.js, and modern frameworksMany modern frameworks — especially Vite and Next.js — scaffold projects with a dev script for development but no start script. If you habitually type npm start, you will hit this error every time.
Check what scripts exist
npm runIf you see 'dev' but not 'start'
# Use this instead of npm start
npm run devOr add a start alias pointing to dev
{
"scripts": {
"dev": "next dev",
"start": "next dev" // alias — both commands now work
}
}The convention in modern JavaScript is: 'dev' = development with hot reload, 'start' = production server. If you only have a dev environment, using 'npm run dev' is perfectly correct — you do not need a start script.
Framework Quick Reference — Correct Start Commands
Bookmark this table. It covers the correct commands to start every major JavaScript framework — and which ones use npm start vs npm run dev.
Framework Start Commands
| Framework | Dev command | Production start | npm start works? |
|---|---|---|---|
| Next.js | npm run dev | npm start (after build) | ✅ Yes (prod only) |
| Create React App | npm start | npm start | ✅ Yes |
| Vite | npm run dev | npm run preview | ❌ Not by default |
| Express | npm start | npm start | ✅ Yes |
| NestJS | npm run start:dev | npm start | ✅ Yes (prod) |
| Astro | npm run dev | npm run preview | ❌ Not by default |
| Angular | npm start | npm start | ✅ Yes |
| Vue CLI | npm run serve | npm run serve | ❌ Uses 'serve' |
| Nuxt 3 | npm run dev | npm run start | ✅ Yes (prod) |
| SvelteKit | npm run dev | npm run preview | ❌ Not by default |
How to Prevent This Error
- Always add a "start" script when initialising a new project — even if it just points to "node index.js"
- Use "npm run" with no arguments to see all available scripts before assuming "npm start" will work
- Commit package.json to version control and never .gitignore it
- Add a README.md to every project documenting how to run it — it saves your future self and your teammates
- In CI/CD pipelines, always verify npm run works before deploying — a missing start script on a server is harder to debug than locally
- After resolving git merge conflicts in package.json, validate the JSON with: node -e "require('./package.json')"
- Use a consistent convention across your projects — pick either npm start or npm run dev and stick to it
Quick Diagnosis — Work Through This in Order
- 1
Run 'npm run' — see if a start script exists at all
If not → add one to package.json
- 2
Check your working directory with pwd / cd
If wrong → cd into your project
- 3
Does it show 'dev' but not 'start'?
Run npm run dev instead
- 4
Is package.json valid JSON?
node -e "require('./package.json')"
- 5
Check which framework you are using
Copy the correct start script from Fix 3
- 6
Still broken? Run node directly
node index.js or node server.js
Frequently Asked Questions
What does "npm ERR! missing script: start" mean?+−
How do I add a start script to package.json?+−
What is the difference between npm start and npm run dev?+−
npm start works locally but fails on the server — why?+−
Can I rename the start script to something else?+−
What should the start script be for a Next.js app?+−
What should the start script be for an Express app?+−
Need Expert Help?
We Build Production-Grade Next.js & Node.js Apps
Softplix is a full-stack development agency. Struggling with npm configuration in a larger project? We can help you ship faster with a clean, scalable setup.
Talk to an Engineer