【问题标题】:I am receiving could not find "htmlextra" reporter when i run it on my local (MAC OSX) neman html report generation当我在本地(MAC OSX)neman html 报告生成上运行它时,我收到找不到“htmlextra”报告器
【发布时间】:2021-01-29 07:18:18
【问题描述】:
当我使用参数 -r htmlextra 运行 newman run 命令时,我收到以下消息。我已经使用-g(全局)安装了htmlextra。但是当我创建一个 newman .js 文件时,我能够执行。请告知可能出了什么问题。
newman: could not find "htmlextra" reporter
ensure that the reporter is installed in the same directory as newman
please install reporter using npm
提前致谢。
【问题讨论】:
标签:
npm
report
command-line-interface
newman
【解决方案1】:
此问题已解决。通过将newman-reporter-html、newman-reporter-htmlextra包复制到newman -> node_modules目录中。
理想情况下,模块必须位于 node_modules 目录中。
它在 mac os x 上。我希望类似的适用于基于 Windows 操作系统的机器。
【解决方案2】:
如果您已经通过 npm install -g htmlextra 安装了 htmlextra 报告器,那么理想情况下您应该使用
newman 运行 yourpostmancollection.json -r htmlextra --reporter-htmlextra-export pathToHtmlReportFile
运行后,报告文件应在给定路径上生成
【解决方案3】:
您可能已经使用 npm i -g newman 安装了 newman 并使用 sudo 或其他方式安装了 html exporter。
确保如果您安装一个包 -g(全局)然后另一个同样,如果 1 sudo 然后另一个也是