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
- Open package.json and add a start script: "start": "node index.js" (or your entry point)
- If using a framework, the correct script may be 'dev': npm run dev
- Verify you're in the project root: ls package.json
- 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.logRunning 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.
