Skip to content

Node.js errornpm: “npm error Missing script: "start"”

npm start, npm run dev or a hosting build stops with npm error Missing script: "start" and a hint to run npm run. npm looked in the scripts section of the package.json it found and there is no entry with that name. Either the script is called something else, or npm is reading a different package.json than you think.

Short answer

Run npm run with no name to list the scripts this package.json has, and use the name it shows (a Vite app has dev, not start). If the list is not what you expect, you are in the wrong folder: cd into the folder with the app’s package.json, or in a monorepo use npm run dev --workspace=packages/web (the folder path, or the name from that package.json). On a hosting platform, set the build command to a script that exists, or the root directory to the app’s folder.

Why npm cannot find the script, and the fix

  1. 01

    The script has a different name

    “This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.” npm, npm run

    Vite and many AI app builders create dev, build and preview, but no start. Next.js and Express starters use start. List the scripts and run the one that is there, or add the missing one.

    npm run          # lists the scripts in this package.json
    
    // package.json
    "scripts": {
      "dev": "vite",
      "build": "vite build",
      "start": "vite preview"
    }
  2. 02

    npm start with no start script

    “If the "scripts" object does not define a "start" property, npm will run node server.js.” npm, npm start

    npm start has a fallback: without a start script it runs node server.js, and without server.js it fails with Missing script. Add a start script that runs your real entry file.

    "scripts": {
      "start": "node index.js"
    }
  3. 03

    Running npm in the wrong folder or monorepo root

    “It's also possible to run a script in a single workspace using the workspace config along with a name or directory path:” npm, npm run: Filtering workspaces

    npm uses the nearest package.json at or above the current folder. Missing script appears when that file is the wrong one: a monorepo root, or a parent project, with different scripts. (With no package.json at all, npm reports ENOENT: Could not read package.json instead.) Change into the app’s folder, or run the script in its workspace from the root. On Vercel, Netlify or Render, set the root directory to the app folder.

    cd my-app && npm run dev
    # or, from a monorepo root (folder path, or the package name)
    npm run dev --workspace=packages/web
  4. 04

    A CI step for a script some packages do not have

    “If true, npm will not exit with an error code when run is invoked for a script that isn't defined in the scripts section of package.json.” npm, npm run: if-present

    A shared pipeline that runs npm run lint or npm run test fails on a package without that script. Add --if-present so the step is skipped where the script does not exist.

    npm run lint --if-present

Checked against the vendor’s docs on : npm docs: npm run; npm docs: npm start; npm docs: scripts.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: npm “ELIFECYCLE” · Vercel “npm run build exited with 1” · Node.js “ENOENT: no such file or directory”

Questions

More on this error

Why does npm run dev work but npm start does not?

They are separate entries in package.json. A Vite project defines dev but not start, so npm start falls back to node server.js and, with no server.js, reports Missing script: "start".

Does it matter which folder I run npm in?

Yes. npm uses the nearest package.json at or above the current folder. From a subfolder it can pick up a parent project’s package.json, and from a monorepo root it reads the root package.json, each with different scripts.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.