# 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.

Source: https://shutdown.jscrate.dev/docs/codes/sc002
Last updated: 2026-09-23

`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 | `No launch command configured` |
| 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()`:

```ts
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.

## Related

- [Node API](https://shutdown.jscrate.dev/docs/node-api)
- [Configure the launch command](https://shutdown.jscrate.dev/docs/configuration#command-cwd-and-env)
- [SC101: Service exited before ready](https://shutdown.jscrate.dev/docs/codes/sc101)
