Skip to content
Latchkey

Node.js "command failed" from concurrently in CI

concurrently runs several commands in parallel and fails the group when any one exits non-zero. In CI a watch/server command that never exits, or a flaky sibling, takes the whole step down.

What this error means

A step using concurrently fails reporting one command exited with a non-zero code, or the step hangs because a long-running watcher never exits.

node
[build] tsc -w exited with code 0
[test] jest exited with code 1
--> Sending SIGTERM to other processes..
ERROR: "test" exited with 1.

Common causes

A parallel command failed

One of the concurrent commands exited non-zero. With the default kill-others behavior, concurrently fails the group.

A long-running command never exits in CI

Pairing a watcher/server with a finite task in concurrently means the group never completes unless configured to exit on the finite task.

How to fix it

Configure success and kill behavior

Use flags so the group succeeds based on the right command and shuts down cleanly.

package.json
concurrently --kill-others-on-fail \
  --success first \
  "npm:server" "npm:test"

Use a sequential or readiness-gated flow in CI

For CI, prefer starting the server, waiting for readiness, then running the finite task in sequence.

  1. Start the server in the background.
  2. Wait on its port/health with wait-on.
  3. Run the test/build, then the job exits naturally.

How to prevent it

  • Set explicit --success/--kill-others semantics for concurrently.
  • Avoid pairing infinite watchers with finite tasks in CI.
  • Prefer readiness-gated sequential flows for CI steps.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →