ProjectStack
npm

npm ERR! missing script: start

npm tried to run the 'start' script from your package.json but it isn't defined there. npm scripts must be explicitly declared before you can call them with npm run.

Common causes

  • The 'start' key is missing from the scripts section in package.json
  • package.json doesn't exist in the current directory
  • You're in the wrong directory — the project root has the package.json, not a subdirectory
  • The script was renamed (e.g. to 'dev' or 'serve') and hasn't been aliased

How to fix it

  1. Open package.json and add a start script: "start": "node index.js" (or your entry point)
  2. If using a framework, the correct script may be 'dev': npm run dev
  3. Verify you're in the project root: ls package.json
  4. List available scripts to find the right one: npm run

Example

npm ERR! missing script: start npm ERR! A complete log of this run can be found in: npm ERR! /Users/user/.npm/_logs/2024-01-01T00_00_00_000Z-debug-0.log

Running npm start in a project that hasn't defined a start script in package.json

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.