是否因为我的机器中的网络代理设置?我也在公司防火墙下。
错误:在appium-chromedriver@2.9.2安装脚本'节点失败 安装-npm.js'
请帮我解决这个问题
paranth@paranth-ThinkCentre-M73:~$ 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
> appium-chromedriver@2.9.2 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: fsevents@1.0.14
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! appium-chromedriver@2.9.2 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@2.9.2 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 :(得分:0)
在linux中设置android自动化:
a)linuxbrew安装:https://github.com/Linuxbrew/linuxbrew b)下载并将android sdk解压缩到主文件夹:http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz c)设置android sdk路径:
按命令打开文件:
sudo gedit~ / .bashrc
在文件末尾添加以下行: 添加linux brew路径
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)逐个运行这些命令:
机器人
(它将打开sdk管理器,并从Tools文件夹和Android 6.0 API 23安装所有sdk工具)
brew install node
npm install -g appium
appium&
(它将启动运行自动化所需的appium服务器)
答案 1 :(得分:0)
退出防火墙或业务网络,并尝试使用个人数据网络。它会起作用。它对我有用。
然后尝试" npm install -g appium"