[英]npm cannot install protractor or selenium-webdriver -> gyp ERR! build error
For an Angular project I wrote some E2E test and I would like to test them, but I cannot install protractor or selenium-webdriver, I get the error message: 对于一个Angular项目,我写了一些E2E测试,我想对其进行测试,但是我无法安装量角器或selenium-webdriver,我得到了错误消息:
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/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 Linux 3.19.0-26-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
I have searched this error on stackoverflow and github, but haven't come closer to getting past this error. 我已经在stackoverflow和github上搜索了此错误,但是还没有越过该错误。
I am using npm -v 2.14.0 on Ubuntu 15.04. 我在Ubuntu 15.04上使用npm -v 2.14.0。 The gyp dependencies are met: Python 2.7.9, make and gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) 满足gyp依赖关系:Python 2.7.9,make和gcc版本4.9.2(Ubuntu 4.9.2-10ubuntu13)
A paste of the full output of npm install protractor
is here: http://pastebin.com/yz2z0Cnh npm install protractor
完整输出的粘贴在这里: http : //pastebin.com/yz2z0Cnh
After reading npm install, node-gyp build error on only one of two identical machines I tried these three commands: 在阅读npm install之后,仅在两台相同的机器之一上发生了node-gyp构建错误,我尝试了以下三个命令:
$ npm cache clean
$ rm -rf node_modules
$ rm -rf ~/.node-gyp
And after that was able to npm install -g protractor
so found an answer myself. 之后便可以npm install -g protractor
以便自己找到答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.