postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.88k stars 1.16k forks source link

"newman run collection.json -e env.json --reporters html" throws error #1048

Closed therahulprasad closed 7 years ago

therahulprasad commented 7 years ago
  1. Newman Version (can be found via newman -v): 3.6.0
  2. OS details (type, version, and architecture): Ubuntu 16.04 64bit
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: recently
  5. Expected behaviour: no-error
  6. Command / script used to run Newman: newman run collection.json -e env.json --reporters html
  7. Sample collection, and auxilliary files (minus the sensitive details): Cant provide.
  8. Screenshots (if applicable): N/A

Steps to reproduce the problem:

  1. newman run collection.json -e env.json --reporters html

Error:

/usr/lib/node_modules/newman/lib/reporters/html/index.js:76
                    reducedExecution.response = reducedExecution.response.toJSON();
                                                                          ^

TypeError: reducedExecution.response.toJSON is not a function
    at /usr/lib/node_modules/newman/lib/reporters/html/index.js:76:75
    at /usr/lib/node_modules/newman/node_modules/lodash/lodash.js:13767:16
    at arrayEach (/usr/lib/node_modules/newman/node_modules/lodash/lodash.js:537:11)
    at Function.transform (/usr/lib/node_modules/newman/node_modules/lodash/lodash.js:13766:43)
    at EventEmitter.<anonymous> (/usr/lib/node_modules/newman/lib/reporters/html/index.js:60:28)
    at EventEmitter.emit (/usr/lib/node_modules/newman/node_modules/eventemitter3/index.js:151:33)
    at done (/usr/lib/node_modules/newman/lib/run/index.js:196:29)
    at /usr/lib/node_modules/newman/node_modules/postman-runtime/lib/backpack/index.js:56:34
    at PostmanCollectionRun._process (/usr/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:122:20)
    at PostmanCollectionRun.<anonymous> (/usr/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:133:18)
reinouts commented 7 years ago

In https://stackoverflow.com/a/44042745/412834 it is suggested to comment index.js line 76 which should solve the issue. It appears that line 76 is the only place where reducedExecution.response is used(?).

kunagpal commented 7 years ago

@therahulprasad Can you share the collection.json and env.json files that cause this?

therahulprasad commented 7 years ago

Can't 😞

rapidroamer commented 7 years ago

On Fri, 9 Jun 2017 at 5:22 pm Rahul Prasad notifications@github.com wrote:

Can't 😞

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/postmanlabs/newman/issues/1048#issuecomment-307315798, or mute the thread https://github.com/notifications/unsubscribe-auth/AVBeoFaHUmEd_JA4ksg-LSmpouSow395ks5sCPKygaJpZM4NonEb .

My guess is it happenes only in node on windows and not on unix.

reinouts commented 7 years ago

@rapidroamer Negative, it happens on Linux as well.

czardoz commented 7 years ago

What node version are you guys on?

reinouts commented 7 years ago

@czardoz Docker node:6-alpine comes with 6.11.0 according to the documentation.

therahulprasad commented 7 years ago

For me, It happened on Linux

kunagpal commented 7 years ago

This issue has been fixed in Newman v3.6.1, do check it out 😄