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.
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
- Confirm where the collection lives with a quick
lsin the workflow. - Pass the full path relative to the checkout root.
- Re-run so Newman resolves the file.
newman run tests/postman/collection.json \
-e tests/postman/ci.postman_environment.jsonEnsure the collection is committed
Verify the collection JSON is tracked in git and present after checkout, not ignored or produced by a skipped step.
- uses: actions/checkout@v4
- run: ls -la tests/postmanHow 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.