Newman-reporter-html命令行下载newman: could not find “html“ reporter

查看是否已存在Newman-reporter-html

使用   

npm list -g newman-reporter-html

命令查看,如果有则显示

尝试在保存的json文件路径下的命令行执行

newman run xxxx.json(你的文件) -e 环境文件(无则省略) -d  数据文件(无则省略) -r html --reporter-html-export xx.html(保存报告名称)

如果报错newman: could not find “html“ reporter

则需要下降Node版本

在如下链接下载

https://nodejs.org/dist/v14.17.3/

通常选择https://nodejs.org/dist/v14.17.3/node-v14.17.3-win-x64.zip

按需选择

然后将nodejs文件全部替换为压缩包内的文件

在nodejs里创建node_global和node_cache文件夹(原本没有,图中为自己所创),在系统环境变量里进行相应的设置(其他博主那里可以看)

然后按照顺序执行

npm install -g newman@5.3.2

执行完可以用命令

newman -v

检查是否为所要求版本5.3.2

随后

执行降低版本

npm install npm@6.14.10 -g --no-fund

运行

npm install -g newman-reporter-html --no-fund

最后执行

newman run xxxx.json(你的文件) -r html 

记住在文件所在路径命令行运行,或者在命令中标明路径。

newman run 测试.json -r html --reporter-html-export report1.html

如此,便可以完成postman的newman生成测试报告的环境部署。

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值