npmNode.jsError Fix2026 Updated

npm ERR! Missing Script: Start— Fixed [Complete Guide 2026]

January 20266 min readnpm 9–10 · All Frameworks

⚡ Quickest Fix — 60 seconds

Open your package.json and add a start script. Pick the right command for your framework:

package.json
{
  "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:

Terminal Error
npm ERR! Missing script: "start"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

When 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

1

Add a "start" Script to package.json

Most common fix
1 minute

The 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

package.json
{
  "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:

terminal
npm run

If 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'.

2

You Are in the Wrong Directory

Very common — check this early
30 seconds

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

terminal
# 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 start

Run '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.

3

Start Scripts by Framework

Next.js · React · Express · Vite · more
1 minute

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

package.json — Next.js
{
  "scripts": {
    "dev": "next dev",        // development
    "build": "next build",    // create production build
    "start": "next start",    // serve production build
    "lint": "next lint"
  }
}

Create React App

package.json — 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:

package.json — Vite
{
  "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

package.json — Express or Node.js
{
  "scripts": {
    "start": "node server.js",
    "dev": "nodemon server.js"   // hot reload in development
  }
}

NestJS

package.json — NestJS
{
  "scripts": {
    "start": "nest start",
    "start:dev": "nest start --watch",
    "start:prod": "node dist/main"
  }
}

Astro

package.json — Astro
{
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",     // alias so npm start works
    "build": "astro build",
    "preview": "astro preview"
  }
}

Angular

package.json — Angular
{
  "scripts": {
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test"
  }
}
4

package.json Is Corrupted, Empty, or Missing

After bad merges or manual edits
2 minutes

If 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

terminal
# 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:

Terminal Error
<<<<<<< HEAD
  "start": "node index.js",
=======
  "start": "node server.js",
>>>>>>> feature-branch

Open the file, resolve the conflict by keeping the correct version, delete the conflict markers, and save. Then verify it is valid JSON:

terminal
node -e "require('./package.json')" && echo 'Valid'

If package.json is genuinely missing

terminal
npm init -y
# Then manually add your scripts section

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

5

Run Node Directly Without a Start Script

Quick workaround
30 seconds

If 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:

terminal
# Run your entry point file directly
node index.js
node server.js
node app.js
node src/index.js

This 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

terminal
npx next dev
npx vite
npx astro dev
6

Wrong Script Name — Use "npm run dev" Instead

Vite, Next.js, and modern frameworks
30 seconds

Many 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

terminal
npm run

If you see 'dev' but not 'start'

terminal
# Use this instead of npm start
npm run dev

Or add a start alias pointing to dev

package.json
{
  "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

FrameworkDev commandProduction startnpm start works?
Next.jsnpm run devnpm start (after build)✅ Yes (prod only)
Create React Appnpm startnpm start✅ Yes
Vitenpm run devnpm run preview❌ Not by default
Expressnpm startnpm start✅ Yes
NestJSnpm run start:devnpm start✅ Yes (prod)
Astronpm run devnpm run preview❌ Not by default
Angularnpm startnpm start✅ Yes
Vue CLInpm run servenpm run serve❌ Uses 'serve'
Nuxt 3npm run devnpm run start✅ Yes (prod)
SvelteKitnpm run devnpm run preview❌ Not by default

How to Prevent This Error

Quick Diagnosis — Work Through This in Order

  1. 1

    Run 'npm run' — see if a start script exists at all

    If not → add one to package.json

  2. 2

    Check your working directory with pwd / cd

    If wrong → cd into your project

  3. 3

    Does it show 'dev' but not 'start'?

    Run npm run dev instead

  4. 4

    Is package.json valid JSON?

    node -e "require('./package.json')"

  5. 5

    Check which framework you are using

    Copy the correct start script from Fix 3

  6. 6

    Still broken? Run node directly

    node index.js or node server.js

Frequently Asked Questions

What does "npm ERR! missing script: start" mean?+
It means npm tried to run the "start" script defined in the scripts section of your package.json, but that key does not exist. npm has no idea what command to run to start your app, so it throws this error.
How do I add a start script to package.json?+
Open package.json and add a "scripts" section if it does not exist, then add "start" as a key with the command to run your app as its value. For example: { "scripts": { "start": "node index.js" } }. Then run npm start again.
What is the difference between npm start and npm run dev?+
"npm start" runs the "start" script — conventionally used for production. "npm run dev" runs the "dev" script — conventionally used for development with hot reloading. Many frameworks like Next.js and Vite only define "dev" by default, so you must run npm run dev, not npm start, during development.
npm start works locally but fails on the server — why?+
The most common cause is that your server is running npm start from a different directory than the one containing your package.json, or your production package.json is missing the start script that your local copy has. Check that your deployment pipeline copies the correct package.json and runs npm install before npm start.
Can I rename the start script to something else?+
Yes, but only "start", "test", "stop", and "restart" are special npm lifecycle scripts that can be run with "npm scriptname" (no "run" required). Any other script name requires "npm run scriptname". So if you rename "start" to "launch", you would need "npm run launch".
What should the start script be for a Next.js app?+
For Next.js in production: "start": "next start". For development: "dev": "next dev". You must run "npm run build" before "npm start" in a Next.js app — next start serves the production build and will fail if no build exists.
What should the start script be for an Express app?+
For Express: "start": "node index.js" or "start": "node server.js" — wherever your Express app entry point is. For development with auto-restart, use "dev": "nodemon index.js" instead.

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