gpt4 book ai didi

node.js - Protractor 安装上的 node-gyp 错误

转载 作者:搜寻专家 更新时间:2023-10-31 23:41:56 25 4
gpt4 key购买 nike

我正在尝试通过运行 npm install -g protractor 来安装 Protractor ,我得到了以下输出,但我不确定这些错误是否值得关注。看起来有人试图安装 utf-8-validate 和 bufferutil。在该命令之后,它运行 node-gyp rebuild 但失败并出现 MSB8020 错误。它引用了我没有的 Visual Studio 2010。我有 Visual Studio 2012,它是最新的。

Microsoft 建议按特定顺序安装 Visual Studio 版本,例如:Visual Studio 2010,然后是 Visual Studio 2012,等等。

在我尝试完成所有这些之前...解决这些错误以获得良好的 Protractor 设置有多重要?我真的需要 utf-8-validate 和 bufferutil 吗?

其他信息:

  • Windows 8.1
  • Node.js v0.12.4
  • Python v2.7.3
  • Java v1.8.0_45-b14

我希望我问的方式正确,因为这是我的第一个 StackExchange 问题。

谢谢大家!

C:\Users\jack\AppData\Roaming>npm install -g protractor
\
> utf-8-validate@1.2.1 install C:\Users\jack\AppData\Roaming\npm\node_modules
\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-v
alidate
> node-gyp rebuild


C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\node_modules\seleni
um-webdriver\node_modules\ws\node_modules\utf-8-validate>if not defined npm_conf
ig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..
\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild)
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.t
argets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform
Toolset = 'v100') cannot be found. To build using the v100 build tools, either
click the Project menu or right-click the solution, and then select "Update VC+
+ Projects...". Install Visual Studio 2010 to build using the Visual Studio 201
0 build tools. [C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\no
de_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate\build
\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\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.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\node_m
odules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

> bufferutil@1.2.1 install C:\Users\jack\AppData\Roaming\npm\node_modules\pro
tractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild


C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\node_modules\seleni
um-webdriver\node_modules\ws\node_modules\bufferutil>if not defined npm_config_n
ode_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\
node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (rebuild)
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.t
argets(42,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform
Toolset = 'v100') cannot be found. To build using the v100 build tools, either
click the Project menu or right-click the solution, and then select "Update VC+
+ Projects...". Install Visual Studio 2010 to build using the Visual Studio 201
0 build tools. [C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\no
de_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil\build\buf
ferutil.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\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.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jack\AppData\Roaming\npm\node_modules\protractor\node_m
odules\selenium-webdriver\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
npm WARN optional dep failed, continuing bufferutil@1.2.1
C:\Users\jack\AppData\Roaming\npm\webdriver-manager -> C:\Users\jack\AppDa
ta\Roaming\npm\node_modules\protractor\bin\webdriver-manager
C:\Users\jack\AppData\Roaming\npm\protractor -> C:\Users\jack\AppData\Roam
ing\npm\node_modules\protractor\bin\protractor
protractor@2.4.0 C:\Users\jack\AppData\Roaming\npm\node_modules\protractor
├── jasminewd@1.1.0
├── jasminewd2@0.0.6
├── html-entities@1.1.3
├── q@1.0.0
├── minijasminenode@1.1.1
├── adm-zip@0.4.4
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── jasmine@2.3.2 (exit@0.1.2, jasmine-core@2.3.4)
├── accessibility-developer-tools@2.6.0
├── saucelabs@1.0.1 (https-proxy-agent@1.0.0)
├── source-map-support@0.2.10 (source-map@0.1.32)
├── lodash@2.4.2
├── request@2.57.0 (caseless@0.10.0, aws-sign2@0.5.0, forever-agent@0.6.1, strin
gstream@0.0.4, tunnel-agent@0.4.1, oauth-sign@0.8.0, isstream@0.1.2, json-string
ify-safe@5.0.1, node-uuid@1.4.3, qs@3.1.0, combined-stream@1.0.5, form-data@0.2.
0, mime-types@2.0.14, http-signature@0.11.0, bl@0.9.4, tough-cookie@2.0.0, hawk@
2.3.1, har-validator@1.8.0)
└── selenium-webdriver@2.47.0 (tmp@0.0.24, rimraf@2.4.3, xml2js@0.4.4, ws@0.8.0)

最佳答案

看起来您实际上可能在使用构建工具时遇到问题。试试这个:

npm install protractor -g --msvs_version=2012

这将与您也可以访问的构建工具的特定版本一起安装。

看看是否可行!

关于node.js - Protractor 安装上的 node-gyp 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32892744/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com