SC002 means runCheck() received a config with no launch command. There is
nothing to start, so the run ends before a process is created.
| Code | SC002 FAIL |
|---|---|
| Stage | Before launch |
| CLI exit code | 1 |
| What it means | The configuration has no command to start the service. |
| Message |
|
| First thing to check | Set command to an argument array, for example ["node", "server.js"]. |
Why do I see this code only with runCheck()?
The CLI and checkShutdown() validate input first. They reject an empty
command as a config error and exit or throw before the runner starts.
runCheck() accepts an already validated CheckConfig, so a hand-built object
can reach this code.
How do I fix it?
Validate the input with parseConfig() or loadConfig() before calling
runCheck():
import { parseConfig, runCheck } from "shutdown-check";
const config = parseConfig({
command: ["node", "dist/server.js"],
baseUrl: "http://127.0.0.1:3000",
readiness: { path: "/health" },
workload: { path: "/slow", started: { type: "response-headers" } },
});
const result = await runCheck(config);For most scripts and tests, call checkShutdown() instead. It validates the
object and runs the check in one step.
How do I verify the fix?
Log or inspect the parsed config and confirm command[0] is the executable.
The next run should create a process launched event. If the executable or
entry file is wrong, the run moves to SC101 and captured stderr explains why.
Do not cast an arbitrary object to CheckConfig to silence TypeScript. That
removes the type error without adding runtime validation.