2016-01-22 26 views
5

Possiedo un'applicazione Cordova sviluppata con Visual Studio 2015 IDE. Per gestire librerie e dipendenze, ho provato a utilizzare NuGet. Ma sembra che NuGet non possa gestire gli script lato client come i CSS. Così ho esplorato BOWER. Ho installato Bower utilizzando il comando npm installl -g bower e ora posso accedere a tutti i comandi Bower.Impossibile installare i pacchetti Bower

Quando provo ad aggiungere dipendenze come jQuery e jQuery Mobile, prova a scaricare e non funziona. L'errore che dà è,

PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git 
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\Bower.cmd" install --force-latest 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 1.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 1.4s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 3.0s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 3.1s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 4.8s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 7.0s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 9.7s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 8.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jQuery failed with ECONNRESET, retrying in 26.5s 
bower       retry Request to https://bower.herokuapp.com/packages/jquery-mobile failed with ECONNRESET, retrying in 25.6s 
bower jQuery#*    ECONNRESET Request to https://bower.herokuapp.com/packages/jQuery failed: tunneling socket could not be established, cause=connect ETIMEDOUT 
====Executing command 'npm install'==== 


npm WARN package.json [email protected] No description 
npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 

====npm command completed with exit code 0==== 

ho passato in rassegna e si dice che devo impostare procura come,

http_proxy = http://<user>:<password>@<your company proxy>:<port> 
https_proxy= http://<user>:<password>@<your company proxy>:<port> 

o creare un file chiamato .bowerrc e inserire il codice di superare proxy.

{ 
    "directory": "library", 
    "registry": "http://bower.herokuapp.com", 
    "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/", 
    "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/" 
} 

Ma niente ha funzionato. Ora ho provato con la rete aperta con nessun proxy, sto ottenendo lo stesso errore. Mi manca qualche passaggio fondamentale?

Ho anche provato dalla finestra del prompt dei comandi. Ho avuto lo stesso errore

+0

sei in grado di accedere a https://bower.herokuapp.com/packages con un browser? – Shuping

+0

Sì, posso accedere allo stesso dal browser. L'URL ** https: //bower.herokuapp.com/packages/jQuery** mi ha dato una risposta '{" nome ":" jQuery "," url ":" git: //github.com/jquery/jquery. git "," hits ": 47370}' – Joseph

+0

Ho provato a reinstallare NodeJs, Cordova e Bower. Ma non poteva farlo bene. Qualcuno può condividere le loro idee che mi aiutano a risolvere il problema. Sperimentato molti thread e blog ma senza fortuna – Joseph

risposta

1

Avete già provato a cambiare il protocollo git da https a git eseguendo:

git config --global url."git://".insteadOf https:// 
2

Grazie per il vostro sostegno. In realtà ho trovato la ragione. Anche se non sono sotto il mio proxy aziendale, ho impostato una proprietà nelle variabili di ambiente. Questo implica un proxy anche se sono sotto una rete aperta. Non ho idea di quale software abbia fatto la voce nelle variabili di ambiente. L'ho rimosso e ora funziona.

+0

Come chiama questa variabile? L'hai appena cancellato? o un altro ... Perché ho lo stesso problema. –

Problemi correlati