2017-04-04 165 views
0

我試圖用命令來安裝Appium:npm install -g [email protected]Node.js的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 [email protected] 
npm WARN deprecated [email protected]: Babel 5 is no longer being maintained. Up 
grade to Babel 6. 
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher 
to avoid a RegExp DoS issue 
npm WARN deprecated [email protected]: 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 

> [email protected] 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: [email protected] (node_modules\appiu 
m\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected] 
1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} 
) 
npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
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-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 

回答

0

確保Homebrew具有最新版本的節點包。在終端類型下面的命令。

brew update 

嘗試安裝最新版本的node.js。

brew upgrade node 
0

更新Node/npm解決了我的安裝問題。