我正在尝试通过运行npm install -g量角器安装量角器,我得到以下输出,我不确定是否有关注的错误。看起来有尝试安装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吗?
其他信息:
我希望我以正确的方式提出这个问题,因为这是我的第一个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)
答案 0 :(得分:4)
看起来您实际上可能遇到使用构建工具的问题。试试这个:
npm install protractor -g --msvs_version=2012
将使用您也可以访问的特定版本的构建工具进行安装。
看看是否有效!