# Newman --env-var not being used

**URL:** <https://community.postman.com/t/newman-env-var-not-being-used/16627>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [October 9, 2020, 7:27pm UTC](https://community.postman.com/t/newman-env-var-not-being-used/16627 "2020-10-09T19:27:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulsc](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@paulsc](https://community.postman.com/u/paulsc)\
**Post date:** [October 9, 2020, 7:27pm UTC](https://community.postman.com/t/newman-env-var-not-being-used/16627/1 "2020-10-09T19:27:36Z")

</div>

Everything I have read so far says this should work. For some reason the ‘base\_url’ value is never updated to the value passed in. Is there something obvious I’m missing? Thanks.

newman run [https://api.getpostman.com/collections/uuid?apikey=key](https://api.getpostman.com/collections/uuid?apikey=key) --environment [https://api.getpostman.com/environments/uuid?apikey=key](https://api.getpostman.com/environments/uuid?apikey=key) –-env-var base\_url=“localhost:5000”

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 9, 2020, 7:52pm UTC](https://community.postman.com/t/newman-env-var-not-being-used/16627/2 "2020-10-09T19:52:39Z")

</div>

Hey @paulsc

Welcome to the community!! 👋

The syntax doesn’t look quite right to me, would this work?

```auto
--env-var "base_url=localhost:5000"

```

Just need to ensure that you have a variable in the collection called `{{base_url}}`.

---

<div class="post-metadata">

**Author:** ![paulsc](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@paulsc](https://community.postman.com/u/paulsc)\
**Post date:** [October 9, 2020, 8:02pm UTC](https://community.postman.com/t/newman-env-var-not-being-used/16627/3 "2020-10-09T20:02:31Z")

</div>

@danny-dainton Thanks for the reply.

I should have mentioned I tried it quoted as you have it with the same result. I have a GET request that references {{base\_url}} and hovering over it shows the variables scope as Environment. I also tried setting it as a global and passing it as --global-var with the same result. I must be overlooking something obvious. Thanks.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 9, 2020, 9:43pm UTC](https://community.postman.com/t/newman-env-var-not-being-used/16627/4 "2020-10-09T21:43:59Z")

</div>

Have you tried with a variation of variable names?

Try with `baseURL` or just `URL`, basically anything without the underscore in the name. Not sure it that’s impacting it but worth a try.

I have a reporter that shows which variables and values are used if that’s any use to you?

> **[DannyDainton/newman-reporter-htmlextra](https://github.com/DannyDainton/newman-reporter-htmlextra)**
>
> A HTML reporter for Postman's Command Line Runner, Newman. Includes Non Aggregated Runs broken down by Iterations, Skipped Tests, Console Logs and the handlebars helpers module for better cust...

You can see the variables by using the `--reporter-htmlextra-showEnvironmentData` flag.
