安装newman 步骤,问题,解决方法

node.js安装
node -v
npm -v npm
install newman -g
修改配置环境变量path:(一般是安装后自动添加)
D:\目录\nodejs;
D:\目录\nodejs\npm_modules;

进入postman下载脚本和对应环境变量
执行脚本命令:
newman run (接口文件) -e (环境变量) -d (脚本.csv)-r cli,html --reporter-html-export (输出位置.html)
可保存为.bat格式 双击直接运行(需要ANSI编码格式)

遇到的问题:newman: required node version >=10
原因:版本过低
解决:控制面板卸载,找到安装时目录 删除 安装

提示 Error: EPERM: operation not permitted, mkdir
1.在变量环境path种设置nodejs目录中的modules,
2.以管理员身份运行

切换镜像源
1.npm install nrm -g
nrm ls
nrm use taobao

2.(推荐)npm install -g cnpm – registry=https://registry.npm.taobao.org
再次安装cnpm install newman -g

使用jenkins执行
https://www.jenkins.io/
jenkins
乱码设置,在环境变量中加入
JAVA_TOOL_OPTIONS
-Dfile.encoding=UTF-8

Guess you like

Origin blog.csdn.net/lqwcxy/article/details/120982440