【问题标题】:Build error when installing appium through npm in Ubuntu在 Ubuntu 中通过 npm 安装 appium 时出现构建错误
【发布时间】:2015-03-25 21:32:49
【问题描述】:

我一直在尝试设置 Appium 以在 Ubuntu 机器上运行 Android 测试。这是我到目前为止所做的:

  • 设置 JRE 和 JDK(并设置系统变量);
  • 不使用 sudo 安装 node.js/npm;
  • 已安装 Android SDK 和 API 级别 22(并设置系统 变量);
  • 已安装 Apache Ant(尚未配置);
  • 已安装 git(并在 gitconfig 上设置名称和电子邮件)

当我运行npm install -g appium 时,我得到:

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/andre/node-v0.12.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/home/andre/node-v0.12.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/andre/node-v0.12.1-linux-x64/lib/node_modules/appium/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/andre/node-v0.12.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "node" "/home/andre/node-v0.12.1-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/andre/node-v0.12.1-linux-x64/lib/node_modules/appium/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.0.1
npm WARN optional dep failed, continuing bufferutil@1.0.1
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
npm ERR! git clone git://github.com/vojtajina/traceur-compiler Cloning into bare repository '/home/andre/.npm/_git-remotes/git-github-com-vojtajina-traceur-compiler-f4c43c65'...
npm ERR! git clone git://github.com/vojtajina/traceur-compiler fatal: unable to connect to github.com:
npm ERR! git clone git://github.com/vojtajina/traceur-compiler github.com[0: 192.30.252.128]: errno=Refused connection
npm ERR! Linux 3.13.0-32-generic
npm ERR! argv "/home/andre/node-v0.12.1-linux-x64/bin/node" "/home/andre/node-v0.12.1-linux-x64/bin/npm" "install" "-g" "appium"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code 128
npm ERR! Command failed: git clone --template=/home/andre/.npm/_git-remotes/_templates --mirror git://github.com/vojtajina/traceur-compiler /home/andre/.npm/_git-remotes/git-github-com-vojtajina-traceur-compiler-f4c43c65
npm ERR! Cloning into bare repository '/home/andre/.npm/_git-remotes/git-github-com-vojtajina-traceur-compiler-f4c43c65'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.128]: errno=Refused connection
npm ERR!
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /home/andre/npm-debug.log

【问题讨论】:

    标签: android git ubuntu automated-tests appium


    【解决方案1】:

    点击此链接: 我已经创建了在 linux 上安装 Appium 的分步过程

    http://install-appium-on-linux.blogspot.com/2015/01/install-ruby-sudo-apt-get-install-build.html

    【讨论】:

    • 你好克里希纳,谢谢你的回答!不幸的是,我之前遇到过同样的问题。
    【解决方案2】:

    发现问题。由于我在企业网络中,所以我在代理后面。所以我无法使用 git。

    使用下面的命令,我能够使用 https 而不是 http 克隆文件夹。

    git config --global url."https://github.com/".insteadOf git@github.com:
    git config --global url."https://".insteadOf git://
    

    【讨论】:

      猜你喜欢
      • 2014-11-02
      • 2018-12-23
      • 2015-06-12
      • 2012-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      相关资源
      最近更新 更多