当我 运行 在本地 (MAC OSX) neman html 报告生成时,我收到找不到 "htmlextra" 记者的消息

I am receiving could not find "htmlextra" reporter when i run it on my local (MAC OSX) neman html report generation

当我使用 运行 newman 运行 命令和参数 -r htmlextra 时,我收到以下消息。我已经使用 -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

提前致谢。

此问题已解决。通过复制 newman-reporter-html、newman-reporter-htmlextra 包到 newman -> node_modules 目录。

理想情况下,模块必须位于 node_modules 目录中。

它在 mac os x 上。我希望类似的适用于 windows OS 基于 machines.

如果您已经通过 npm install -g htmlextra 安装了 htmlextra reporter 那么理想情况下您应该使用

来生成报告

newman 运行 yourpostmancollection.json -r htmlextra --reporter-htmlextra-export pathToHtmlReportFile

在此之后 运行应该在给定路径上生成报告文件

您可能已经使用 npm i -g newman 安装了 newman,并使用 sudo 或其他方式安装了 html exporter。

确保如果你安装了一个包 -g (global) 然后另一个同样,如果 1 sudo 然后另一个