# Environment Variable Not updating when running on Newman

**URL:** <https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652>\
**Category:** Help Hub\
**Tags:** newman-project, variables, environments, collections\
**Created:** [August 29, 2022, 12:35pm UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652 "2022-08-29T12:35:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rukshansnookie](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rukshansnookie](https://community.postman.com/u/rukshansnookie)\
**Post date:** [August 29, 2022, 12:35pm UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/1 "2022-08-29T12:35:04Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, 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](https://github.com/postmanlabs/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](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

- Requests are working well in postman and when I tried to export my collection via a file/link and run it in Newman, Predefined environment variable not updating.

 ![env var error](https://us1.discourse-cdn.com/getpostman/original/2X/7/71a776d5031611b6a4d1b06cd5856c5cb907801d.jpeg)

- I’m passing two other parameters after the environment variable but those parameters also not including in the shared link which i used to run in newman.

- I’ve already tried to place Environment variable in different environments and also changed variable name several times but still getting this error.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [August 30, 2022, 10:18am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/2 "2022-08-30T10:18:08Z")

</div>

Can you post the Newman command line that you are using? To check you are including the environment file in the request?

Can you include a copy of your environment JSON file?

Something like.

```auto
newman run postman_collection.json -e postman_environment.json --reporters cli,junit --reporter-junit-export Results\junitReport.xml 

```

---

<div class="post-metadata">

**Author:** ![rukshansnookie](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rukshansnookie](https://community.postman.com/u/rukshansnookie)\
**Post date:** [August 30, 2022, 11:00am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/3 "2022-08-30T11:00:01Z")

</div>

Thank you for your response,

Right now i only use this commands,

`newman run postman_collection.json(link)`

my previous collection is running without any error with same steps.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [August 30, 2022, 11:11am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/4 "2022-08-30T11:11:23Z")

</div>

@rukshansnookie

Where are your variables set? In particular where is the UUID set?

> **[Using variables | Postman Learning Center](https://learning.postman.com/docs/sending-requests/variables/)**
>
> Using variables: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

At the environment level, collection or other?

---

<div class="post-metadata">

**Author:** ![rukshansnookie](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rukshansnookie](https://community.postman.com/u/rukshansnookie)\
**Post date:** [August 31, 2022, 4:21am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/5 "2022-08-31T04:21:31Z")

</div>

![env vari](https://us1.discourse-cdn.com/getpostman/original/2X/a/ac3cfc7b023ceff7c1387a2abd41919b3274fb2b.jpeg)

As you can see here, i passed them to Environment level, “NicGlob” variable working well with requests. “UUID” still not updating when run in newman

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [August 31, 2022, 8:51am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/6 "2022-08-31T08:51:16Z")

</div>

@rukshansnookie

If you have them at the environment level, then surely you have to include that environment file in the Newman command line, otherwise it will fail. They are saved in a separate file to the collection and you have to reference both files in your command line. The collection and the environment. (Both are json files).

Similar to the following…

```auto
newman run postman_collection.json -e postman_environment.json --reporters cli,junit --reporter-junit-export Results\junitReport.xml 

```

I can’t answer why NicGlob is working ok. Perhaps it has an initial value set in your code somewhere. Difficult to say without seeing the whole collection.

---

<div class="post-metadata">

**Author:** ![rukshansnookie](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rukshansnookie](https://community.postman.com/u/rukshansnookie)\
**Post date:** [August 31, 2022, 12:47pm UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/7 "2022-08-31T12:47:29Z")

</div>

i’ve tried many ways but still getting the same error and finally i decided to remove that environment variable and pass its values through parameters.  
btw i really appreciate your support and thank you .

---

<div class="post-metadata">

**Author:** ![aviation-operator-22](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@aviation-operator-22](https://community.postman.com/u/aviation-operator-22)\
**Post date:** [February 13, 2023, 12:30am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/8 "2023-02-13T00:30:27Z")

</div>

This error is still occurring when passing in an environment json file along with a collection to run using the Newman cli. It does not matter if I pass the host in before or after the collection argument. This is running on the latest ubuntu with the latest versions available. It seems everyone else running into this error is simply hard coding the variables to fix.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 13, 2023, 11:05am UTC](https://community.postman.com/t/environment-variable-not-updating-when-running-on-newman/38652/9 "2023-02-13T11:05:13Z")

</div>

@aviation-operator-22

Can you post your Newman command line, a sanitized screenshot of your environment, and a copy of your request where it uses the variables?

Environments work fine with Newman.

I can’t see that it running on Ubuntu would be an issue.  
I have a couple of Linux boxes, and can try this out a bit later.
