1

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

npm -g install appium

在 10 mnts 后点击命令后,我遇到了有关 chrome deiver 安装的错误。

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
4

2 回答 2

0

如果您在代理后面,请尝试在运行 npm 命令之前进行设置,例如 set HTTP_PROXY= http://[proxy server address]:[port number]

于 2018-05-25T11:42:03.903 回答
0

我在通过 NPM 安装 node 8.x 和 Appium 时也遇到了一些问题。确实为 Appium 1.8.0 和 Node 10.0.0发现了新打开的已知问题,因此必须将其中一个建议与额外的标志结合起来。这为我修复它:

编辑:

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

于 2018-05-03T10:06:05.110 回答