5

I have a Cordova Application which is developed using Visual Studio 2015 IDE. To manage libraries and dependencies, I tried using NuGet. But it looks like, NuGet cannot manage client side scripts ie CSS. So I explored BOWER. I installed bower using the command npm installl -g bower and now I can access all Bower commands.

When I try to add dependencies like jQuery and jQuery Mobile, It try fetching and it failed. The error it gives is,

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 WellnessAdvisor@1.0.0 No description
npm WARN package.json WellnessAdvisor@1.0.0 No repository field.
npm WARN package.json WellnessAdvisor@1.0.0 No README data

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

I browsed and it is said that I have to set proxy like,

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

or create a file named .bowerrc and place the code to overcome 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>/"
}

But nothing worked. Now I tried with open network with No proxy, I am getting the same error. Am I missing any basic step ?

I also tried from command prompt window. Got same error.

Joseph
  • 1,060
  • 3
  • 22
  • 53
  • are you able to access https://bower.herokuapp.com/packages with a browser? – Shuping Jan 25 '16 at 09:17
  • Yes, I can access the same from browser. The URL **https://bower.herokuapp.com/packages/jQuery** gave me a response `{"name":"jQuery","url":"git://github.com/jquery/jquery.git","hits":47370}` – Joseph Jan 25 '16 at 12:32
  • Tried reinstalling NodeJs, Cordova and Bower. But couldn't get it right. Can anyone share their ideas which help me in resolving the issue. Experimented many threads and blogs but no luck – Joseph Jan 28 '16 at 12:37
  • 1
    A few questions to pinpoint the problem: 1.) are you behind a corporate proxy that might prevent your *open network with no proxy* attempt? 2.) did you try using the *git bash* supplied with `git-for-windows`? 3.) did you try cleaning your bower cache with `bower cache clean` and rerunning `bower install`? 4.) can you access the bower url via `wget` or `curl` in the command line? – Leon Adler Jan 29 '16 at 18:18
  • Using the git bash supplied with git-for-windows worked for me, as suggested by [Leon Adler](http://stackoverflow.com/users/5460631/leon-adler). – Brent Jan 08 '17 at 19:44

2 Answers2

2

Thanks for your support. I actually found the reason. Even though, I am not under my corporate proxy, there got set a property in Environment variables. That implies proxy even-though I am under a open network. No idea which software made the entry in Environment variables. I removed that and it works now.

Joseph
  • 1,060
  • 3
  • 22
  • 53
1

Have you already tried to change the git protocol from https to git by executing:

git config --global url."git://".insteadOf https://
haihui
  • 1,075
  • 1
  • 18
  • 25