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 output
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.
Terminal
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.
Related guides
concurrently "command not found" / Non-Zero Exit - Fix Parallel Scripts in CIFix concurrently failing in CI - "concurrently: not found", or one parallel command exiting non-zero failing…
npm pre/post Script Failing the Run - Fix Lifecycle Hook Errors in CIFix surprising CI failures from npm pre/post lifecycle scripts - a failing `pre<x>`/`post<x>` hook fails the…
npm run "spawn ENOENT" / "sh: command not found" - Fix Script Shell in CIFix npm scripts failing with "spawn ENOENT" or "sh: <cmd>: not found" in CI - a command in the script is not…