Skip to content
Latchkey

Newman "newman: command not found" in CI

The shell could not find a newman executable on PATH. On a clean runner Newman is not preinstalled, so it must be installed (usually via npm) before the collection-run step, or invoked through npx.

What this error means

A step running newman run ... fails immediately with "newman: command not found" and exit code 127, before any collection is loaded.

bash
/home/runner/work/_temp/script.sh: line 1: newman: command not found
Error: Process completed with exit code 127.

Common causes

Newman was never installed on the runner

GitHub-hosted runners do not ship Newman. Without an install step the newman binary does not exist on PATH.

A global npm install that did not land on PATH

A npm install -g newman in one step may not persist its bin directory to PATH for a later step, so the command is still not found.

How to fix it

Install Newman before running the collection

  1. Add a step that installs Newman globally with npm.
  2. Run newman --version to confirm it is on PATH.
  3. Then run your collection.
.github/workflows/ci.yml
- run: npm install -g newman
- run: newman run collection.json

Invoke via npx to skip a global install

npx resolves and runs Newman without a persistent global install, avoiding PATH issues between steps.

Terminal
npx -y newman run collection.json

How to prevent it

  • Pin Newman as a devDependency and call it via npx or a package script.
  • Verify with newman --version right after installing.
  • Prefer running through npm scripts so the local bin is on PATH.

Related guides

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