Shutdown Check

Search documentation

Find a page or section

SC002: No launch command

SC002 (no launch command) means runCheck got a config with an empty command array. Why the CLI shows a config error instead, and how to fix it.

SC002 means runCheck() received a config with no launch command. There is nothing to start, so the run ends before a process is created.

CodeSC002 FAIL
StageBefore launch
CLI exit code1
What it meansThe configuration has no command to start the service.
Message
  • No launch command configured
First thing to checkSet 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.