npm "Missing script" - Fix npm run for a Script That Does Not Exist
npm run executes a named entry from the scripts block. "Missing script" means that name is not defined where npm looked - a typo, the wrong package.json, or the wrong workspace.
What this error means
npm run <name> fails with npm error Missing script: "<name>" and lists available scripts. Nothing runs because the script is not in the package.json npm resolved.
npm error Missing script: "buld"
npm error
npm error To see a list of scripts, run:
npm error npm runCommon causes
Typo or undefined script name
The script name passed to npm run does not match any key in scripts (e.g. buld vs build).
Wrong working directory or workspace
In a monorepo, running from the root (or the wrong package) means the script lives in a different package.json than the one npm read.
How to fix it
List scripts and run the right name
See what scripts exist where you are, and target the correct package.
npm run # lists available scripts
# in a workspace, target the package:
npm run build -w @acme/webCheck directory and workspace
- Confirm you are in the directory whose package.json defines the script.
- For monorepos, use
-w <name>to target the right workspace. - Fix the script name typo in the CI invocation.
How to prevent it
- Define every script your CI invokes in the right package.json.
- Use
-wto target workspace scripts explicitly. - Run
npm runto confirm available scripts.