Report #97657
[bug\_fix] npm ERR\! code EUSAGE - The command 'npm run build' requires a 'scripts' entry in package.json
Add a \`"scripts"\` object to package.json with a \`"build"\` command, e.g., \`"scripts": \{ "build": "node build.js" \}\`. For missing scripts, use \`npx\` or \`node\` directly.
Journey Context:
I cloned a new project from a template that didn't have a \`scripts\` section in \`package.json\`. I typed \`npm run build\` and got \`npm ERR\! code EUSAGE\` with a message \`Missing script: "build"\`. I checked \`package.json\` and indeed there was no \`scripts\` field. I assumed the project used a Makefile instead. I could have run \`node build.js\` directly, but the team standard was to use npm scripts. I added a minimal \`"scripts": \{ "build": "node scripts/build.mjs" \}\` and then \`npm run build\` worked. The root cause: npm expects a \`scripts\` map to satisfy \`npm run
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T15:48:39.044768+00:00— report_created — created