2016-10-04 161 views
0

是否因为我的机器中的网络代理设置?此外,我在企业防火墙下。无法在Ubuntu上安装Appium 16.04

error:Failed at the [email protected] install script 'node install-npm.js'

请帮我解决这个问题

[email protected]:~$ npm install -g appium 
    /home/paranth/.linuxbrew/bin/appium -> /home/paranth/.linuxbrew/lib/node_modules/appium/build/lib/main.js 
    /home/paranth/.linuxbrew/bin/authorize-ios -> /home/paranth/.linuxbrew/lib/node_modules/appium/node_modules/.bin/authorize-ios 

    > [email protected] install /home/paranth/.linuxbrew/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver 
    > node install-npm.js 

    info Chromedriver Install Installing Chromedriver version '2.21' for platform 'linux' and architecture '64' 
    info Chromedriver Install Opening temp file to write chromedriver_linux64 to... 
    info Chromedriver Install Downloading http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip... 
    info Chromedriver Install Writing binary content to /tmp/201694-10666-t0tuz0.b4lorsh5mi/chromedriver_linux64.zip... 
    info Chromedriver Install Extracting /tmp/201694-10666-t0tuz0.b4lorsh5mi/chromedriver_linux64.zip to /tmp/201694-10666-t0tuz0.b4lorsh5mi/chromedriver_linux64 
    Invalid or unsupported zip format. No END header found 
    /home/paranth/.linuxbrew/lib 
    `-- (empty) 

    npm WARN optional Skipping failed optional dependency /appium/fsevents: 
    npm WARN notsup Not compatible with your operating system or architecture: [email protected] 
    npm ERR! Linux 4.4.0-38-generic 
    npm ERR! argv "/home/paranth/.linuxbrew/Cellar/node/6.7.0/bin/node" "/home/paranth/.linuxbrew/bin/npm" "install" "-g" "appium" 
    npm ERR! node v6.7.0 
    npm ERR! npm v3.10.7 
    npm ERR! code ELIFECYCLE 

    npm ERR! [email protected] install: `node install-npm.js` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] install script 'node install-npm.js'. 
    npm ERR! Make sure you have the latest version of node.js and npm installed. 
    npm ERR! If you do, this is most likely a problem with the appium-chromedriver package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  node install-npm.js 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs appium-chromedriver 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls appium-chromedriver 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  /home/paranth/npm-debug.log 
    npm ERR! code 1 

回答

0

设定Android自动化的Linux:

一)linuxbrew安装:https://github.com/Linuxbrew/linuxbrew 二)下载并解压Android SDK中到主文件夹:http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz c)设置android sdk路径:

    通过命令
  1. 打开文件:

    须藤gedit中的〜/ .bashrc

在该文件的末尾添加这些行: 将Linux添加酿造路径

export PATH="$HOME/.linuxbrew/bin:$PATH" 
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH" 

#android 
export ANDROID_HOME=/home/asci/android-sdk-linux 
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools 

关闭文件。 运行命令:

source ~/.bashrc 

E)运行这些命令逐个:

  1. 的Android

(这将打开SDK管理器,并安装所有SDK工具来自Tools文件夹和Android 6.0 API 23)

  1. 酿造安装节点

  2. NPM安装-g appium

  3. appium &

(它会启动运行自动化所需的appium服务器)

0

走出防火墙或业务网络,并尝试从个人数据网络。它会工作。它为我工作。然后尝试“npm install -g appium”