简体   繁体   English

npm无法安装量角器或selenium-webdriver-> gyp ERR! 建立错误

[英]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.

相关问题 无法安装selenium-webdriver - Not able to install selenium-webdriver 无法在Ubuntu 19.04上安装Ruby gem selenium-webdriver - Unable to install Ruby gem selenium-webdriver on Ubuntu 19.04 Ubuntu 18.04 - npm 更新 - 错误:canvas@2.6.1 安装:`node-pre-gyp install --fallback-to-build` - Ubuntu 18.04 - npm update - Error: canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build` 尝试安装指南针 npm ERR 时出错! 无法读取未定义的属性“长度” - Getting error when trying to install compass npm ERR! Cannot read property 'length' of undefined npm 错误! 代码 EACCES, npm install --global yarn met error - npm ERR! code EACCES, npm install --global yarn met error 如何在Chromium中使用Ruby gem selenium-webdriver? - How do I use Ruby gem selenium-webdriver with Chromium? 用Rails selenium-webdriver无头通过Linux服务器获取网页屏幕 - headless with rails selenium-webdriver to take a screen of webpage by linux server 如何修复此错误“gyp ERR:堆栈错误:EACCES,权限被拒绝,mkdir '/home/mohamedessam/Desktop/NodeJs/node_modules/bcrypt/build'” - How to fix this error "gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/mohamedessam/Desktop/NodeJs/node_modules/bcrypt/build'" 安装npm软件包时出现“ node-gyp”错误 - 'node-gyp' error in installing npm packages npm install会导致像npm ERR这样的错误! Debian上的tar.unpack解压错误 - npm install causes errors like npm ERR! tar.unpack untar error on Debian
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM