How can I run a collection with specified environment via Newman

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

I have a collection for specified environment.
How can I run that collection for that environment via Newman?

For example: In my collection I have this kind of requests:
{{url_production}}/streams/remove/{{private collection id}}.json?key{{json_key}}

{{url_production}} - environment
{{private collection id}} - global
{{json_key}} - global

I have exported both the environment and the Collection JSON files but when I run the collection via Newman all cases are going to fail. (See the screenshot)
How this will be done?

P.S the the values of globals which are mentioned in the url are generated by previous requests in the collection.
How can we do with globals as well? I mean every time after sending the same request I should get different values of globals and this collection I need to run via Newman.
Thanks in advance.

It seems that the environment was not picked up by newman.

Are you sure you have specified it using --environment and that the path is correct?

@sero.barseghyan As @vdespa mentioned you are either referencing your environment JSON file incorrectly or not at all.

Can you give us a sample of the command you are issuing so we can see the parameters you are passing?

Newman basically requires 2 parameters to be able to run. The Collection and the Environment, everything else is optional, so by the sounds of it you may just have a small config issue here.