Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporter could not be loaded. #1969

Closed
karam94 opened this issue Apr 10, 2019 · 11 comments
Closed

Reporter could not be loaded. #1969

karam94 opened this issue Apr 10, 2019 · 11 comments

Comments

@karam94
Copy link

karam94 commented Apr 10, 2019

Using TeamCity with build agents on AWS.
However, despite installing both newman & newman-reporter-teamcity globally, the reporter still cannot be loaded.

I have a feeling that this is due to the reporter being installed by npm somewhere differently to newman.
npm list -g suggests it is installed globally regardless. Any ideas?

Steps taken:

npm install -g newman
npm install -g newman-reporter-teamcity

npm root -g:
C:\Windows\system32\config\systemprofile\AppData\Roaming\npm\node_modules

where newman:
C:\Users\Administrator\AppData\Roaming\npm\newman

npm config get prefix:
C:\Windows\system32\config\systemprofile\AppData\Roaming\npm

npm list -g:

[10:15:13][Step 4/6] +-- newman@4.4.1
[10:15:13][Step 4/6] | +-- async@2.6.1
[10:15:13][Step 4/6] | | `-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | +-- chardet@0.7.0
[10:15:13][Step 4/6] | +-- cli-progress@2.1.1
[10:15:13][Step 4/6] | | +-- colors@1.3.3 deduped
[10:15:13][Step 4/6] | | `-- string-width@2.1.1
[10:15:13][Step 4/6] | |   +-- is-fullwidth-code-point@2.0.0
[10:15:13][Step 4/6] | |   `-- strip-ansi@4.0.0
[10:15:13][Step 4/6] | |     `-- ansi-regex@3.0.0
[10:15:13][Step 4/6] | +-- cli-table3@0.5.1
[10:15:13][Step 4/6] | | +-- colors@1.3.3 deduped
[10:15:13][Step 4/6] | | +-- object-assign@4.1.1
[10:15:13][Step 4/6] | | `-- string-width@2.1.1 deduped
[10:15:13][Step 4/6] | +-- colors@1.3.3
[10:15:13][Step 4/6] | +-- commander@2.19.0
[10:15:13][Step 4/6] | +-- csv-parse@4.0.1
[10:15:13][Step 4/6] | +-- eventemitter3@3.1.0
[10:15:13][Step 4/6] | +-- filesize@4.1.2
[10:15:13][Step 4/6] | +-- lodash@4.17.11
[10:15:13][Step 4/6] | +-- mkdirp@0.5.1
[10:15:13][Step 4/6] | | `-- minimist@0.0.8
[10:15:13][Step 4/6] | +-- postman-collection@3.4.6
[10:15:13][Step 4/6] | | +-- escape-html@1.0.3
[10:15:13][Step 4/6] | | +-- file-type@3.9.0
[10:15:13][Step 4/6] | | +-- http-reasons@0.1.0
[10:15:13][Step 4/6] | | +-- iconv-lite@0.4.24
[10:15:13][Step 4/6] | | | `-- safer-buffer@2.1.2
[10:15:13][Step 4/6] | | +-- liquid-json@0.3.1
[10:15:13][Step 4/6] | | +-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | | +-- marked@0.6.1
[10:15:13][Step 4/6] | | +-- mime-format@2.0.0
[10:15:13][Step 4/6] | | | `-- charset@1.0.1
[10:15:13][Step 4/6] | | +-- mime-types@2.1.22
[10:15:13][Step 4/6] | | | `-- mime-db@1.38.0
[10:15:13][Step 4/6] | | +-- postman-url-encoder@1.0.1
[10:15:13][Step 4/6] | | +-- sanitize-html@1.20.0
[10:15:13][Step 4/6] | | | +-- chalk@2.4.2
[10:15:13][Step 4/6] | | | | +-- ansi-styles@3.2.1
[10:15:13][Step 4/6] | | | | | `-- color-convert@1.9.3
[10:15:13][Step 4/6] | | | | |   `-- color-name@1.1.3
[10:15:13][Step 4/6] | | | | +-- escape-string-regexp@1.0.5
[10:15:13][Step 4/6] | | | | `-- supports-color@5.5.0
[10:15:13][Step 4/6] | | | |   `-- has-flag@3.0.0
[10:15:13][Step 4/6] | | | +-- htmlparser2@3.10.1
[10:15:13][Step 4/6] | | | | +-- domelementtype@1.3.1
[10:15:13][Step 4/6] | | | | +-- domhandler@2.4.2
[10:15:13][Step 4/6] | | | | | `-- domelementtype@1.3.1 deduped
[10:15:13][Step 4/6] | | | | +-- domutils@1.7.0
[10:15:13][Step 4/6] | | | | | +-- dom-serializer@0.1.1
[10:15:13][Step 4/6] | | | | | | +-- domelementtype@1.3.1 deduped
[10:15:13][Step 4/6] | | | | | | `-- entities@1.1.2 deduped
[10:15:13][Step 4/6] | | | | | `-- domelementtype@1.3.1 deduped
[10:15:13][Step 4/6] | | | | +-- entities@1.1.2
[10:15:13][Step 4/6] | | | | +-- inherits@2.0.3 deduped
[10:15:13][Step 4/6] | | | | `-- readable-stream@3.3.0
[10:15:13][Step 4/6] | | | |   +-- inherits@2.0.3 deduped
[10:15:13][Step 4/6] | | | |   +-- string_decoder@1.2.0
[10:15:13][Step 4/6] | | | |   | `-- safe-buffer@5.1.2 deduped
[10:15:13][Step 4/6] | | | |   `-- util-deprecate@1.0.2
[10:15:13][Step 4/6] | | | +-- lodash.clonedeep@4.5.0
[10:15:13][Step 4/6] | | | +-- lodash.escaperegexp@4.1.2
[10:15:13][Step 4/6] | | | +-- lodash.isplainobject@4.0.6
[10:15:13][Step 4/6] | | | +-- lodash.isstring@4.0.1
[10:15:13][Step 4/6] | | | +-- lodash.mergewith@4.6.1
[10:15:13][Step 4/6] | | | +-- postcss@7.0.14
[10:15:13][Step 4/6] | | | | +-- chalk@2.4.2 deduped
[10:15:13][Step 4/6] | | | | +-- source-map@0.6.1
[10:15:13][Step 4/6] | | | | `-- supports-color@6.1.0
[10:15:13][Step 4/6] | | | |   `-- has-flag@3.0.0 deduped
[10:15:13][Step 4/6] | | | +-- srcset@1.0.0
[10:15:13][Step 4/6] | | | | +-- array-uniq@1.0.3
[10:15:13][Step 4/6] | | | | `-- number-is-nan@1.0.1
[10:15:13][Step 4/6] | | | `-- xtend@4.0.1
[10:15:13][Step 4/6] | | +-- semver@5.6.0 deduped
[10:15:13][Step 4/6] | | `-- uuid@3.3.2
[10:15:13][Step 4/6] | +-- postman-collection-transformer@3.0.0
[10:15:13][Step 4/6] | | +-- commander@2.19.0 deduped
[10:15:13][Step 4/6] | | +-- inherits@2.0.3
[10:15:13][Step 4/6] | | +-- intel@1.2.0
[10:15:13][Step 4/6] | | | +-- chalk@1.1.3
[10:15:13][Step 4/6] | | | | +-- ansi-styles@2.2.1
[10:15:13][Step 4/6] | | | | +-- escape-string-regexp@1.0.5 deduped
[10:15:13][Step 4/6] | | | | +-- has-ansi@2.0.0
[10:15:13][Step 4/6] | | | | | `-- ansi-regex@2.1.1
[10:15:13][Step 4/6] | | | | +-- strip-ansi@3.0.1
[10:15:13][Step 4/6] | | | | | `-- ansi-regex@2.1.1
[10:15:13][Step 4/6] | | | | `-- supports-color@2.0.0
[10:15:13][Step 4/6] | | | +-- dbug@0.4.2
[10:15:13][Step 4/6] | | | +-- stack-trace@0.0.10
[10:15:13][Step 4/6] | | | +-- strftime@0.10.0
[10:15:13][Step 4/6] | | | +-- symbol@0.3.1
[10:15:13][Step 4/6] | | | `-- utcstring@0.1.0
[10:15:13][Step 4/6] | | +-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | | +-- semver@5.6.0 deduped
[10:15:13][Step 4/6] | | `-- strip-json-comments@2.0.1
[10:15:13][Step 4/6] | +-- postman-request@2.88.1-postman.8
[10:15:13][Step 4/6] | | +-- aws-sign2@0.7.0
[10:15:13][Step 4/6] | | +-- aws4@1.8.0
[10:15:13][Step 4/6] | | +-- caseless@0.12.0
[10:15:13][Step 4/6] | | +-- combined-stream@1.0.7
[10:15:13][Step 4/6] | | | `-- delayed-stream@1.0.0
[10:15:13][Step 4/6] | | +-- extend@3.0.2
[10:15:13][Step 4/6] | | +-- forever-agent@0.6.1
[10:15:13][Step 4/6] | | +-- form-data@2.3.3
[10:15:13][Step 4/6] | | | +-- asynckit@0.4.0
[10:15:13][Step 4/6] | | | +-- combined-stream@1.0.7 deduped
[10:15:13][Step 4/6] | | | `-- mime-types@2.1.22 deduped
[10:15:13][Step 4/6] | | +-- har-validator@5.1.3
[10:15:13][Step 4/6] | | | +-- ajv@6.10.0
[10:15:13][Step 4/6] | | | | +-- fast-deep-equal@2.0.1
[10:15:13][Step 4/6] | | | | +-- fast-json-stable-stringify@2.0.0
[10:15:13][Step 4/6] | | | | +-- json-schema-traverse@0.4.1
[10:15:13][Step 4/6] | | | | `-- uri-js@4.2.2
[10:15:13][Step 4/6] | | | |   `-- punycode@2.1.1 deduped
[10:15:13][Step 4/6] | | | `-- har-schema@2.0.0
[10:15:13][Step 4/6] | | +-- http-signature@1.2.0
[10:15:13][Step 4/6] | | | +-- assert-plus@1.0.0
[10:15:13][Step 4/6] | | | +-- jsprim@1.4.1
[10:15:13][Step 4/6] | | | | +-- assert-plus@1.0.0 deduped
[10:15:13][Step 4/6] | | | | +-- extsprintf@1.3.0
[10:15:13][Step 4/6] | | | | +-- json-schema@0.2.3
[10:15:13][Step 4/6] | | | | `-- verror@1.10.0
[10:15:13][Step 4/6] | | | |   +-- assert-plus@1.0.0 deduped
[10:15:13][Step 4/6] | | | |   +-- core-util-is@1.0.2
[10:15:13][Step 4/6] | | | |   `-- extsprintf@1.3.0 deduped
[10:15:13][Step 4/6] | | | `-- sshpk@1.16.1
[10:15:13][Step 4/6] | | |   +-- asn1@0.2.4
[10:15:13][Step 4/6] | | |   | `-- safer-buffer@2.1.2 deduped
[10:15:13][Step 4/6] | | |   +-- assert-plus@1.0.0 deduped
[10:15:13][Step 4/6] | | |   +-- bcrypt-pbkdf@1.0.2
[10:15:13][Step 4/6] | | |   | `-- tweetnacl@0.14.5 deduped
[10:15:13][Step 4/6] | | |   +-- dashdash@1.14.1
[10:15:13][Step 4/6] | | |   | `-- assert-plus@1.0.0 deduped
[10:15:13][Step 4/6] | | |   +-- ecc-jsbn@0.1.2
[10:15:13][Step 4/6] | | |   | +-- jsbn@0.1.1 deduped
[10:15:13][Step 4/6] | | |   | `-- safer-buffer@2.1.2 deduped
[10:15:13][Step 4/6] | | |   +-- getpass@0.1.7
[10:15:13][Step 4/6] | | |   | `-- assert-plus@1.0.0 deduped
[10:15:13][Step 4/6] | | |   +-- jsbn@0.1.1
[10:15:13][Step 4/6] | | |   +-- safer-buffer@2.1.2 deduped
[10:15:13][Step 4/6] | | |   `-- tweetnacl@0.14.5
[10:15:13][Step 4/6] | | +-- is-typedarray@1.0.0
[10:15:13][Step 4/6] | | +-- isstream@0.1.2
[10:15:13][Step 4/6] | | +-- json-stringify-safe@5.0.1
[10:15:13][Step 4/6] | | +-- mime-types@2.1.22 deduped
[10:15:13][Step 4/6] | | +-- oauth-sign@0.9.0
[10:15:13][Step 4/6] | | +-- performance-now@2.1.0
[10:15:13][Step 4/6] | | +-- postman-url-encoder@1.0.1 deduped
[10:15:13][Step 4/6] | | +-- qs@6.5.2
[10:15:13][Step 4/6] | | +-- safe-buffer@5.1.2
[10:15:13][Step 4/6] | | +-- stream-length@1.0.2
[10:15:13][Step 4/6] | | | `-- bluebird@2.11.0
[10:15:13][Step 4/6] | | +-- tough-cookie@2.5.0
[10:15:13][Step 4/6] | | | +-- psl@1.1.31
[10:15:13][Step 4/6] | | | `-- punycode@2.1.1
[10:15:13][Step 4/6] | | +-- tunnel-agent@0.6.0
[10:15:13][Step 4/6] | | | `-- safe-buffer@5.1.2 deduped
[10:15:13][Step 4/6] | | `-- uuid@3.3.2 deduped
[10:15:13][Step 4/6] | +-- postman-runtime@7.11.0
[10:15:13][Step 4/6] | | +-- async@2.6.1 deduped
[10:15:13][Step 4/6] | | +-- aws4@1.8.0 deduped
[10:15:13][Step 4/6] | | +-- btoa@1.2.1
[10:15:13][Step 4/6] | | +-- crypto-js@3.1.9-1
[10:15:13][Step 4/6] | | +-- eventemitter3@3.1.0 deduped
[10:15:13][Step 4/6] | | +-- http-reasons@0.1.0 deduped
[10:15:13][Step 4/6] | | +-- httpntlm@1.7.6
[10:15:13][Step 4/6] | | | +-- httpreq@0.4.24
[10:15:13][Step 4/6] | | | `-- underscore@1.7.0
[10:15:13][Step 4/6] | | +-- inherits@2.0.3 deduped
[10:15:13][Step 4/6] | | +-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | | +-- node-oauth1@1.2.2
[10:15:13][Step 4/6] | | | `-- crypto-js@3.1.9-1 deduped
[10:15:13][Step 4/6] | | +-- performance-now@2.1.0 deduped
[10:15:13][Step 4/6] | | +-- postman-collection@3.4.6 deduped
[10:15:13][Step 4/6] | | +-- postman-request@2.88.1-postman.8 deduped
[10:15:13][Step 4/6] | | +-- postman-sandbox@3.2.6
[10:15:13][Step 4/6] | | | +-- inherits@2.0.3 deduped
[10:15:13][Step 4/6] | | | +-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | | | +-- uuid@3.3.2 deduped
[10:15:13][Step 4/6] | | | `-- uvm@1.7.5
[10:15:13][Step 4/6] | | |   +-- flatted@2.0.0
[10:15:13][Step 4/6] | | |   +-- inherits@2.0.3 deduped
[10:15:13][Step 4/6] | | |   +-- lodash@4.17.11 deduped
[10:15:13][Step 4/6] | | |   `-- uuid@3.3.2 deduped
[10:15:13][Step 4/6] | | +-- resolve-from@4.0.0
[10:15:13][Step 4/6] | | +-- serialised-error@1.1.3 deduped
[10:15:13][Step 4/6] | | `-- uuid@3.3.2 deduped
[10:15:13][Step 4/6] | +-- pretty-ms@4.0.0
[10:15:13][Step 4/6] | | `-- parse-ms@2.0.0
[10:15:13][Step 4/6] | +-- semver@5.6.0
[10:15:13][Step 4/6] | +-- serialised-error@1.1.3
[10:15:13][Step 4/6] | | +-- object-hash@1.3.1
[10:15:13][Step 4/6] | | +-- stack-trace@0.0.9
[10:15:13][Step 4/6] | | `-- uuid@3.3.2 deduped
[10:15:13][Step 4/6] | +-- word-wrap@1.2.3
[10:15:13][Step 4/6] | `-- xmlbuilder@11.0.1
[10:15:13][Step 4/6] `-- newman-reporter-teamcity@0.1.11

newman run PostmanTests\api\suites\CommercialMargins.postman_collection.json -e PostmanTests\api\config\Beta.postman_environment.json -g PostmanTests\api\config\Commercial.postman_globals.json -r teamcity:
[10:15:51][Step 6/6] newman: "teamcity" reporter could not be loaded. [10:15:51][Step 6/6] run npm install newman-reporter-teamcity [10:15:51][Step 6/6] [10:15:52][Step 6/6] Process exited with code 0

Thanks in advance!

@musteray
Copy link

musteray commented Apr 12, 2019

Same issue using newman-reporter-junitfull.

@shamasis
Copy link
Member

@vikiCoder - we need to console.warn the error raised in the line

catch (error) { } // eslint-disable-line no-empty

Otherwise, the error shown is currently not clear whether it is a Lodi g issue or an issue with the reporter itself.

@LayMuiToh
Copy link

I also encounter this issue newman: "htmlextra" reporter could not be loaded.
please install reporter using npm

@DannyDainton
Copy link
Collaborator

Hey @shamasis @vikiCoder @codenirvana

Following on from @shamasis' suggestion - Could we add something like this (The wording can be more helpful) to highlight where the issue might be:

              catch (error) { 
                   console.warn(`Error: ${error.code} - Is "${reporterName}" installed in the same directory as Newman?`);
               }

At the moment, each time someone has an install issue with any reporter, the first place to go looking for an answer is the specific reporter's project, rather than on here.

Or any other solution would be awesome :)

@musteray
Copy link

Hey @karam94

Fixed my issue by adding the reporter in node_modules

@coditva
Copy link
Member

coditva commented Oct 3, 2019

We added warnings so that one can differentiate whether the reporter was not found or was not loaded, in Newman version 4.5.5. @karam94 @LayMuiToh, could you upgrade and verify if the issue was in finding or loading?

@vdespa
Copy link

vdespa commented Oct 8, 2019

@coditva It seems that if the reporter is throwing a JavaScript error (in my case a SyntaxError), this confusing error is being displayed.

What would speak against directly logging the error that has occurred?

@coditva
Copy link
Member

coditva commented Oct 11, 2019

@vdespa If the reporter throws an error while we're require-ing it, we don't log it because in the context of Newman, it is same as not being able to get/find a reporter. We expect that any reporter should be able to export a function without any error as a bare minimum. Also, logging an error that occurred in some other module (which could be anything) doesn't really make sense IMO.

That being said, we do show a warning and log the error when we fail to "load" the reporter, because Newman failed to execute the function successfully, which could be a problem with Newman or the reporter.

@vdespa Hope that clears it up.

@everyone Closing this issue for now since I'm pretty confident that Newman can differentiate between finding and loading a reporter. Feel free to re-open if you feel otherwise.

@coditva coditva closed this as completed Oct 11, 2019
@vdespa
Copy link

vdespa commented Oct 11, 2019

Also, logging an error that occurred in some other module (which could be anything) doesn't really make sense IMO.

I agree here.

Nevertheless, the confusing message is still displayed. Maybe check if there was an error while loading the reporter and just say that an error has occurred while trying to load reporter-xyz.

@lucky36999
Copy link

@coditva @vdespa Still I am getting the same/above issue with Newman reporter for TeamCity. Can you please help in resolving the issue.

image

@coditva
Copy link
Member

coditva commented Nov 18, 2019

@lucky36999 Can you check where is newman installed? For windows, if newman is installed at /somepath/newman, the reporter should be installed at /somepath/node_modules/newman-reporter-teamcity.

e.g. On windows, running where newman would tell you where newman is installed. And if you installed the reporter globally, running npm root -g would tell you where reporter would be installed. These two paths should match.

If they don't match, I would suggest you to run

npm i -g newman newman-reporter-teamcity newman-reporter-html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants