Node.js Appium安装失败

时间:2017-04-04 12:57:07

标签: node.js npm appium

我尝试使用命令npm install -g appium@1.6.4-beta

安装Appium

我支持公司代理。所以我设置了新的代理:

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

我也试过了:

--ignore_ssl--proxy http://10.165.42.170:8080

我的软:

Node.js: v4.6.0
node-gyp -v v3.4.0
npm v4.4.4
Windows 8.1

但我在安装时收到此错误:

C:\Project\taf>npm install -g appium@1.6.4-beta
npm WARN deprecated babel-core@5.8.24: Babel 5 is no longer being maintained. Up
grade to Babel 6.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue
npm WARN deprecated line-numbers@0.2.0: Copy its ~20 LOC directly into your code
 instead.
C:\Users\JE11954\AppData\Roaming\npm\appium -> C:\Users\JE11954\AppData\Roaming\
npm\node_modules\appium\build\lib\main.js

> appium-chromedriver@2.11.0 install C:\Users\JE11954\AppData\Roaming\npm\node_m
odules\appium\node_modules\appium-chromedriver
> node install-npm.js

info Chromedriver Install Installing Chromedriver version '2.28' 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.28/chromedriver_win32.zip...
RequestError: Error: connect ETIMEDOUT 172.217.23.208:443
    at new RequestError (C:\Users\JE11954\AppData\Roaming\npm\node_modules\appiu
m\node_modules\request-promise\lib\errors.js:11:15)
    at Request.RP$callback [as _callback] (C:\Users\JE11954\AppData\Roaming\npm\
node_modules\appium\node_modules\request-promise\lib\rp.js:60:32)
    at self.callback (C:\Users\JE11954\AppData\Roaming\npm\node_modules\appium\n
ode_modules\request\request.js:188:22)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at Request.onRequestError (C:\Users\JE11954\AppData\Roaming\npm\node_modules
\appium\node_modules\request\request.js:884:8)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at TLSSocket.socketErrorListener (_http_client.js:269:9)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at emitErrorNT (net.js:1269:8)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
C:\Users\JE11954\AppData\Roaming\npm
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.x (node_modules\appiu
m\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@2.11.0 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@2.11.0 install script 'node install-n
pm.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 p
ackage,
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! A complete log of this run can be found in:
npm ERR!     C:\Users\JE11954\AppData\Roaming\npm-cache\_logs\2017-04-04T12_46_5
6_785Z-debug.log

2 个答案:

答案 0 :(得分:0)

我不知道是什么导致了这个错误。我通过安装不同的节点版本和npm版本等来解决这个问题很困难但是没有成功。

我已按照以下步骤通过纱线安装了appium:

  1. https://github.com/yarnpkg/yarn/releases
  2. 下载yarn.exe文件
  3. 运行该.exe文件并按说明安装。
  4. 安装完成后,将纱线安装的bin文件夹添加到您的 PATH
    即(在我的机器中:“C:\ Program Files(x86)\ Yarn \ bin \”)
  5. 现在运行以下命令:

    yarn global add appium
    
  6. 这会在你的机器上安装appium。

    如果这也不起作用我可以给出的另一个建议如下:

    一般情况下,如果您通过npm或yarn安装appium它将会安装所有随appium最新GUI版本提供的软件包,即appium 1.7.2,这意味着无论是通过npm还是纱线安装的软件包还将附带appium的GUI版本appium-desktop。请按照以下说明操作:

    1. 从以下链接安装最新的appium-desktop版本:https://github.com/appium/appium-desktop/releases/tag/v1.4.1
    2. 现在转到appium-desktop的安装路径。在我的机器下面是路径:

      C:\Users\pawan.lingutla\AppData\Local\Programs\appium- 
      desktop\resources\app\node_modules\appium
      
    3. 在此文件夹中,您将找到将安装appium的npm附带的所有软件包。

    4. 当您通过npm或yarn将appium安装到node_modules时遇到问题时,这是一种解决方法。

答案 1 :(得分:0)

更新Node / npm解决了我的安装问题。