问题描述
尝试安装 Protractor 2.0.0,我面临以下问题:
Trying to install Protractor 2.0.0, I'm facing the following problem:
$ 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
> [email protected] 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 [email protected]
> [email protected] 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 [email protected]
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
[email protected] C:\Users\clouderial\AppData\Roaming\npm\node_modules\protractor
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
我在 Windows8 下,必须安装 Python (3.4.3) 才能实现此安装.
I'm under Windows8 and I had to install Python (3.4.3) to achieve this installation.
我的 E2E 测试在此安装后被破坏.任何帮助将不胜感激.
My E2E tests are broken after this installation.Any help would be greatly appreciated.
让-马克
推荐答案
有两个问题:1. 必须安装 Python 2.7.x 而不是 Python 3.x,2. 运行npm前必须设置一个名为PYTHON的环境变量,取值为path+python.exe.
There was 2 problems :1. Python 2.7.x must be installed instead of Python 3.x,2. An environment variable named PYTHON valued to path+python.exe must be set before running npm.
此更改后,安装可以继续(但在此处被阻止:安装量角器 2.0 和 MSBUILD 错误 MSB3428)
After this change the installation can continu (but is blocked here : Installation of Protractor 2.0 and MSBUILD error MSB3428)
让-马克.
这篇关于无法安装量角器 2.0.0:在 node-gyp 重建时在 bufferutil 中使用 ENOENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!