Skip to content
Latchkey

Newman "ENOENT: no such file or directory" for the collection in CI

Newman tried to read the collection file at the path you passed and the filesystem returned ENOENT. The path is wrong relative to the runner working directory, or the file was never checked out.

What this error means

Newman aborts immediately with "Error: ENOENT: no such file or directory, open 'collection.json'" before any request runs.

newman
error: unable to read data from file "collection.json"
  ENOENT: no such file or directory, open 'collection.json'

Common causes

The path is relative to the wrong directory

The collection lives in a subfolder (for example tests/postman/) but the run step executes from the repo root, so the bare filename does not resolve.

The file was not checked out or is untracked

The collection is gitignored or generated by an earlier step that did not run, so it is absent when Newman looks for it.

How to fix it

Pass the correct path from the repo root

  1. Confirm where the collection lives with a quick ls in the workflow.
  2. Pass the full path relative to the checkout root.
  3. Re-run so Newman resolves the file.
Terminal
newman run tests/postman/collection.json \
  -e tests/postman/ci.postman_environment.json

Ensure the collection is committed

Verify the collection JSON is tracked in git and present after checkout, not ignored or produced by a skipped step.

.github/workflows/ci.yml
- uses: actions/checkout@v4
- run: ls -la tests/postman

How to prevent it

  • Reference collection and environment files by their full repo-relative path.
  • Commit the exported collection so it is present after checkout.
  • List the directory in CI when a path is uncertain, to catch typos early.

Related guides

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