Newman "newman: command not found" on the runner in CI
The shell could not find a newman executable on PATH because the Postman CLI was never installed on the runner. Node is present, but Newman is a separate npm package.
What this error means
A step calling newman run ... fails with "newman: command not found" and the job exits with code 127.
/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
Newman is not preinstalled on hosted runners. Without an explicit npm install -g newman step it is absent from PATH.
A local install is not on PATH
A project-local npm install newman puts the binary under node_modules/.bin, which is not on PATH unless you call it through npx or a script.
How to fix it
Install Newman globally, then run it
- Add a step that installs newman globally with npm.
- Optionally install the HTML/JUnit reporter you need alongside it.
- Run the collection in a later step.
- run: npm install -g newman newman-reporter-htmlextra
- run: newman run collection.json -e ci.postman_environment.jsonRun Newman through npx without a global install
npx fetches and runs Newman on demand, avoiding a separate install step.
npx newman run collection.json -e ci.postman_environment.jsonHow to prevent it
- Install Newman explicitly in the workflow before the run step.
- Prefer
npx newmanwhen you do not want a global install. - Pin the Newman version so runs are reproducible.