通过 nodejs安装newman

最新学习接口测试时 安装newman遇到了一下问题

已有安装环境: win7 64bit;  chrome postman; nodejs; SDK7.1; ActivePython-2.7.6.9-win64-x64; VS2013;

安装newman时的依赖环境 参考博文:https://github.com/TooTallNate/node-gyp

如何安装参考博文:https://www.npmjs.com/package/newman

安装使用命令:

 由于我装的vs2013, gyp不支持2013,所以把乙醇的命令修改为:npm install -g newman --registry=https://registry.npm.taobao.org --msvs_version=2013  


可安装成功


最近因为换电脑 重新安装newman 总是报错:



 

安装SDK的时候碰到的问题:

Microsoft Windows [版本 6.1.7601]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。



C:\Users\Administrator>npm install -g newman --registry=https://registry.npm.tao

bao.org --msvs_version=2013

|

> [email protected] install C:\Users\Administrator\AppData\Roaming\npm\node_modu

les\newman\node_modules\jsdom\node_modules\contextify

> node-gyp rebuild



C:\Users\Administrator\AppData\Roaming\npm\node_modules\newman\node_modules\jsdo

m\node_modules\contextify>if not defined npm_config_node_gyp (node "D:\Program F

iles\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\n

ode-gyp.js" rebuild )  else (node  rebuild )

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.t

argets(44,5): error MSB8020: The builds tools for v120 (Platform Toolset = 'v12

0') cannot be found. To build using the v120 build tools, either click the Proj

ect menu or right-click the solution, and then select "Update VC++ Projects..."

. Install v120 to build using the v120 build tools. [C:\Users\Administrator\App

Data\Roaming\npm\node_modules\newman\node_modules\jsdom\node_modules\contextify

\build\contextify.vcxproj]

gyp ERR! build error

gyp ERR! stack Error: `msbuild` failed with exit code: 1

gyp ERR! stack     at ChildProcess.onExit (D:\Program Files\nodejs\node_modules\

npm\node_modules\node-gyp\lib\build.js:269:23)

gyp ERR! stack     at ChildProcess.emit (events.js:110:17)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074

:12)

gyp ERR! System Windows_NT 6.1.7601

gyp ERR! command "node" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modu

les\\node-gyp\\bin\\node-gyp.js" "rebuild"

cwd C:\Users\Administrator\AppData\Roaming\npm\node_modules\newman\node_modules\

jsdom\node_modules\contextify

gyp ERR! node -v v0.12.7

gyp ERR! node-gyp -v v2.0.1

gyp ERR! not ok

npm ERR! Windows_NT 6.1.7601

npm ERR! argv "D:\\Program Files\\nodejs\\\\node.exe" "D:\\Program Files\\nodejs

\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "newman" "--registry=https:

//registry.npm.taobao.org" "--msvs_version=2013"

npm ERR! node v0.12.7

npm ERR! npm  v2.11.3

npm ERR! code ELIFECYCLE


npm ERR! [email protected] install: `node-gyp rebuild`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.

npm ERR! This is most likely a problem with the contextify package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     node-gyp rebuild

npm ERR! You can get their info via:

npm ERR!     npm owner ls contextify

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     C:\Users\Administrator\npm-debug.log


C:\Users\Administrator>

解决方案  去这个里面 用这个命令去运行安装包

通过 nodejs安装newman_第1张图片

通过 nodejs安装newman_第2张图片

终于成功了

真是到处都是坑啊

你可能感兴趣的:(接口测试,nodejs;,newman;,vs2013;,SDK7.1;,npm;)