Skip to content
Latchkey

TeamCity "Process exited with code 1" build step failure in CI

A build step ran a process that exited non-zero. TeamCity treats any non-zero exit code from a step as a failure by default. The real error is in the step output above this line.

What this error means

A command-line or script step ends with "Process exited with code 1" (or another non-zero code) and the build is marked failed. The underlying tool printed its own error earlier in the log.

TeamCity
[Step 2/4] npm run build
...
npm ERR! code ELIFECYCLE
Process exited with code 1

Common causes

The command genuinely failed

The tool the step invoked (a compiler, test runner, or script) reported an error and returned exit code 1, which TeamCity surfaces as a step failure.

A non-zero code that should not fail the build

Some tools return non-zero for warnings; the step fails even though the outcome is acceptable, unless the step is configured to ignore it.

How to fix it

Read the tool output above the exit line

  1. Scroll up in the step log to the first real error the command printed.
  2. Fix that root cause (a failing test, a missing file, a compile error).
  3. Re-run the build and confirm the step exits 0.

Adjust failure conditions if the code is expected

If a non-zero code is acceptable, wrap the command so it returns 0 on the acceptable path, or use build failure conditions to define what actually counts as failure.

How to prevent it

  • Make scripts return meaningful exit codes so real failures are distinct from warnings.
  • Keep the underlying tool output visible in the build log for fast diagnosis.
  • Use build failure conditions to define failure intentionally.

Related guides

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