# Postman CLI - pm.response.json() - not working with bigger payloads?

**URL:** <https://community.postman.com/t/postman-cli-pm-response-json-not-working-with-bigger-payloads/85598>\
**Category:** Help Hub\
**Tags:** json-response, postmancli\
**Created:** [October 17, 2025, 8:50am UTC](https://community.postman.com/t/postman-cli-pm-response-json-not-working-with-bigger-payloads/85598 "2025-10-17T08:50:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruxto](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@cruxto](https://community.postman.com/u/cruxto)\
**Post date:** [October 17, 2025, 8:50am UTC](https://community.postman.com/t/postman-cli-pm-response-json-not-working-with-bigger-payloads/85598/1 "2025-10-17T08:50:37Z")

</div>

Hi All.

Has any else experienced the same issue as me I have a test in postman that, get the repsonse and converts it to JSON, but when I try to use the variable, it doesn’t exist on CLI, but does within Postman CLI ☹

I don’t know if it’s a timing thing or what, as the response body is about 5K.

I tried wrapping it with setTimeout, but the CLI ignored that. Only the Postman client works.

This is my code:

```auto
       const responseJson = pm.response.json();
       const totalShipments = responseJson.included.length;

        pm.test(`${totalShipments} shipments on the route`, () => {
            pm.expect(totalShipments).to.be.at.least(0);

        });

```

It fails with this error:  
`Error parsing response: TypeError: Cannot read properties of undefined (reading ‘length’)`

Would anyone have an idea on a way to work around this issue, please? As I say, it works fine in the Postman Client; it’s just CLI.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cruxto](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@cruxto](https://community.postman.com/u/cruxto)\
**Post date:** [October 17, 2025, 9:00am UTC](https://community.postman.com/t/postman-cli-pm-response-json-not-working-with-bigger-payloads/85598/2 "2025-10-17T09:00:47Z")

</div>

Seems like its not the payload that the issue, I can console.log the payload out.

This line is throwing the error.  
const totalShipments = responseJson.included.length;
