Skip to content
Latchkey

concurrently "command not found" / Non-Zero Exit - Fix Parallel Scripts in CI

concurrently runs several npm commands in parallel. It fails in CI when the binary itself is missing (a stripped devDependency), or when one of the parallel commands exits non-zero and concurrently reports the whole run as failed.

What this error means

A concurrently step fails with concurrently: not found, or it runs but exits non-zero because one of the parallel tasks failed. The first case is an install problem; the second is one child command’s real error.

npm output
sh: 1: concurrently: not found
npm error code 127
# or
[1] npm run server exited with code 1
--> Sending SIGTERM to other processes..
concurrently exited with code 1

Common causes

concurrently not installed for this job

concurrently is a devDependency; a --omit=dev install strips it, so the binary is missing (exit 127).

One parallel command failed

By default concurrently fails the run if any command exits non-zero. The real error is in that child command’s output, not concurrently itself.

How to fix it

Install it and read the failing child

Ensure concurrently is present, and find which parallel command actually failed.

Terminal
npm install -D concurrently
# quote each command; name them to read logs:
npx concurrently -n api,web "npm:dev:api" "npm:dev:web"

Tune kill/success behavior

  1. Use --kill-others-on-fail deliberately so one failure tears down the rest.
  2. Set --success semantics if only some commands must succeed (e.g. long-running dev servers in tests).
  3. Quote each command so shell parsing does not split it.

How to prevent it

  • Keep concurrently in devDependencies and installed for the job.
  • Name parallel commands so failures are easy to trace.
  • Configure kill/success behavior to match intent.

Related guides

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