由于chrome驱动程序安装失败,无法从npm安装appium

时间:2018-04-27 06:39:54

标签: appium appium-desktop

我在我的系统中安装了nodejs 8.11.1。尝试使用npm下面的命令安装appium。

npm -g install appium

在10分钟后命中命令后,我发现有关镀铬设备安装的错误。

C:\Windows\system32>npm -g install appium
C:\Users\fedexuser\AppData\Roaming\npm\appium -> C:\Users\fedexuser\AppData\Roam
ing\npm\node_modules\appium\build\lib\main.js

> appium-chromedriver@3.5.2 install C:\Users\fedexuser\AppData\Roaming\npm\node_
modules\appium\node_modules\appium-chromedriver
> node install-npm.js

info Chromedriver Install Installing Chromedriver version '2.37' for platform 'w
in' and architecture '32'
info Chromedriver Install Opening temp file to write chromedriver_win32 to...
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.co
m/2.37/chromedriver_win32.zip...
RequestError: Error: connect ETIMEDOUT 172.217.0.80:443
    at new RequestError (C:\Users\fedexuser\AppData\Roaming\npm\node_modules\app
ium\node_modules\request-promise-core\lib\errors.js:14:15)
    at Request.plumbing.callback (C:\Users\fedexuser\AppData\Roaming\npm\node_mo
dules\appium\node_modules\request-promise-core\lib\plumbing.js:87:29)
    at Request.RP$callback [as _callback] (C:\Users\fedexuser\AppData\Roaming\np
m\node_modules\appium\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at self.callback (C:\Users\fedexuser\AppData\Roaming\npm\node_modules\appium
\node_modules\request\request.js:186:22)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at Request.onRequestError (C:\Users\fedexuser\AppData\Roaming\npm\node_modul
es\appium\node_modules\request\request.js:878:8)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.2 (node_modules\app
ium\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@3.5.2 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@3.5.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\fedexuser\AppData\Roaming\npm-cache\_logs\2018-04-25T10_40
_52_539Z-debug.log

2 个答案:

答案 0 :(得分:0)

我还有一些问题,节点8.x和Appium通过NPM安装。发现Appium 1.8.0和Node 10.0.0新开了Known Issue,因此必须将其中一个建议与额外的标志结合起来。这为我解决了这个问题:

编辑:

sudo npm install -g appium@1.7.2 --unsafe-perm=true --allow-root

答案 1 :(得分:0)

如果您在代理后面,请在运行npm命令之前尝试设置此代理 例如设置HTTP_PROXY = http://[proxy服务器地址]:[端口号]