我正在关注Angular教程https://docs.angularjs.org/tutorial 当我到达第一页的最后一位 - " e2e使用量角器"时,我做" npm运行量角器"在一个新的命令窗口中运行本地站点并运行karma,但是我得到以下错误日志:
0 info it worked if it ends with ok
1 verbose cli [ 'c:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'protractor' ]
2 info using npm@2.11.2
3 info using node@v0.12.5
4 verbose run-script [ 'preprotractor', 'protractor', 'postprotractor' ]
5 info preprotractor angular-phonecat@0.0.0
6 verbose unsafe-perm in lifecycle true
7 info protractor angular-phonecat@0.0.0
8 verbose unsafe-perm in lifecycle true
9 info angular-phonecat@0.0.0 Failed to exec protractor script
10 verbose stack Error: angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js`
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1015:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
11 verbose pkgid angular-phonecat@0.0.0
12 verbose cwd c:\Program Files (x86)\GitExtensions\angular-phonecat
13 error Windows_NT 6.1.7601
14 error argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
15 error node v0.12.5
16 error npm v2.11.2
17 error code ELIFECYCLE
18 error angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js`
18 error Exit status 1
19 error Failed at the angular-phonecat@0.0.0 protractor script 'protractor test/protractor-conf.js'.
19 error This is most likely a problem with the angular-phonecat package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error protractor test/protractor-conf.js
19 error You can get their info via:
19 error npm owner ls angular-phonecat
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]
答案 0 :(得分:1)
我遇到过同样的问题。似乎angular-phonecat软件包附带的chromedriver.zip存档已损坏,无法安装chromedriver。
您可以前往http://chromedriver.storage.googleapis.com/index.html下载适用于您平台的chromedriver的干净存档。
转到此文件夹:yourwebRoot \ angular-phonecat \ node_modules \ protractor \ selenium
从文件夹中删除存档 chromedriver_2.10 ,然后解压缩您在此处下载的存档。
在你的终端类型npm run protractor中再次运行e2e测试。现在应该可以了。