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.
[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.
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.
- Start the server in the background.
- Wait on its port/health with wait-on.
- Run the test/build, then the job exits naturally.
How to prevent it
- Set explicit
--success/--kill-otherssemantics for concurrently. - Avoid pairing infinite watchers with finite tasks in CI.
- Prefer readiness-gated sequential flows for CI steps.