【问题标题】:npm cannot install protractor or selenium-webdriver -> gyp ERR! build errornpm 无法安装量角器或 selenium-webdriver -> gyp ERR!构建错误
【发布时间】:2015-08-25 21:56:04
【问题描述】:

对于一个 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 

我已经在 stackoverflow 和 github 上搜索过这个错误,但还没有接近解决这个错误。

我在 Ubuntu 15.04 上使用 npm -v 2.14.0。满足 gyp 依赖项:Python 2.7.9、make 和 gcc 版本 4.9.2 (Ubuntu 4.9.2-10ubuntu13)

npm install protractor 的完整输出粘贴在这里:http://pastebin.com/yz2z0Cnh

【问题讨论】:

  • 找到解决方案:清理缓存并删除 node_modules 文件夹和 .node-gyp

标签: linux npm protractor node-gyp


【解决方案1】:

看完npm install, node-gyp build error on only one of two identical machines我试过这三个命令:

$ npm cache clean
$ rm -rf node_modules
$ rm -rf ~/.node-gyp

之后就可以npm install -g protractor所以自己找到了答案。

【讨论】:

    猜你喜欢
    • 2021-12-19
    • 1970-01-01
    • 2023-03-17
    • 2022-01-25
    • 2015-12-23
    • 1970-01-01
    • 2020-04-27
    • 1970-01-01
    • 2015-12-07
    相关资源
    最近更新 更多