在 Ubuntu 中通过 npm 安装 appium 时出现构建错误

Build error when installing appium through npm in Ubuntu

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

当我运行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

关注这个link: 我创建了一个在 linux

上安装 Appium 的分步过程

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

找到问题了。因为我在企业网络中,所以我在代理后面。所以我无法使用 git.

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

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