尝试安装Protractor 2.0.0,我遇到了以下问题:
$ npm install -g protractor
npm http GET https://registry.npmjs.org/protractor
npm http 304 https://registry.npmjs.org/protractor
...
npm http 200 https://registry.npmjs.org/nan
> utf-8-validate@1.0.1 install C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate {git}
{lamb} node "d:\Developpement\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:998:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:34)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "d:\\Developpement\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.0.1
> bufferutil@1.0.1 install C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil {git}
{lamb} node "d:\Developpement\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:998:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:34)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "d:\\Developpement\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm WARN optional dep failed, continuing bufferutil@1.0.1
C:\Users\clouderial\AppData\Roaming\npm\protractor -> C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\bin\protractor
C:\Users\clouderial\AppData\Roaming\npm\webdriver-manager -> C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor\bin\webdriver-manager
npm WARN unmet dependency C:\Users\clouderial\AppData\Roaming\npm\node_modules\jmcnet\node_modules\grunt-contrib-watch requires lodash@'~2.4.1' but will load
npm WARN unmet dependency C:\Users\clouderial\AppData\Roaming\npm\node_modules\jmcnet\node_modules\lodash,
npm WARN unmet dependency which is version 3.5.0
protractor@2.0.0 C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor
├── jasminewd@1.1.0
├── jasminewd2@0.0.3
├── html-entities@1.1.2
├── saucelabs@0.1.1
├── q@1.0.0
├── minijasminenode@1.1.1
├── adm-zip@0.4.4
├── lodash@2.4.1
├── accessibility-developer-tools@2.6.0
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── request@2.36.0 (forever-agent@0.5.2, qs@0.6.6, json-stringify-safe@5.0.0, tunnel-agent@0.4.0, aws-sign2@0.5.0, oauth-sign@0.3.0, mime@1.2.11, node-uuid@1.4.3, tough-cookie@0.12.1, http-signature@0.10.1, hawk@1.0.0, form-data@0.1.4)
├── jasmine@2.1.1 (jasmine-core@2.1.3)
├── source-map-support@0.2.10 (source-map@0.1.32)
└── selenium-webdriver@2.45.1 (tmp@0.0.24, rimraf@2.3.2, ws@0.7.1, xml2js@0.4.4)
我在Windows8下,我必须安装Python(3.4.3)才能实现此安装。
安装完成后,我的E2E测试中断了。 任何帮助将不胜感激。
让马克
答案 0 :(得分:2)
有两个问题: 1.必须安装Python 2.7.x而不是Python 3.x, 2.必须在运行npm之前设置一个名为PYTHON的环境变量,其值为path + python.exe。
此更改后,安装可以继续(但在此处被阻止:Installation of Protractor 2.0 and MSBUILD error MSB3428)
让马克。