8

Since I have the same issue as in Bower calls blocked by corporate proxy I have created a config.bowerrc file in AppData/Roaming/... as shown below:

enter image description here

with the following in it - edited with my own settings:

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

However, this does not seem to work as I still get the following message in Visual Studio:

enter image description here

Where should the global config.bowerrc file which sets the proxy be located?

Community
  • 1
  • 1
Atomic Star
  • 5,427
  • 4
  • 39
  • 48

1 Answers1

25

The name of the bower configuration file should be .bowerrc It can be located in one of the following:

  • Local .bowerrc located in the current working directory
  • All .bowerrc files upwards the directory tree
  • .bowerrc file located in user’s home folder (%USERPROFILE%)
  • bowerrc (without the dot) file located in %APPDATA%/bower/config

The config is obtained by merging multiple configurations by this order of importance. Local .bowerrc file has the highest precedence while the global one has the lowest (CLI arguments and environment variables has higher precedence than the bowerrc file).

Dror Bereznitsky
  • 20,048
  • 3
  • 48
  • 57
  • Renamed the file to .bowerrc.txt and placed it in C:\Users\ewalds. That didnt work. Then I placed a bowerrc.txt in C:\Users\ewalds\AppData\config, which also did not work. The 3rd option I tried was placing the .bowerrc.txt file into my project folder, but that also did not work. Any idea what I am doing wrong here? – Atomic Star Sep 22 '14 at 07:39
  • It should be named .bowerrc and not .bowerrc.txt. You will not be able to rename it to .bowerrc from Windows explorer. Instead open the command prompt and rename the file from there. – Dror Bereznitsky Sep 22 '14 at 07:58
  • you can name the file in windows explorer to ".bowerrc." then it works, the dot at the end will be removed by windows. – martinoss Jan 06 '15 at 09:37
  • @drorb: In what order these files (.bowerrc) are read. Lets say I have .bowerrc file located at `current working dir`, in my `home` folder & at `%APPDATA%/bower/config`. Which file will get preference? or will they get merged? – SharpCoder Jan 14 '15 at 11:28
  • @SharpCoder The config is obtained by merging multiple configurations by this order of importance. The order is specified in the link I gave in the answer (starting from local files to global files) – Dror Bereznitsky Jan 14 '15 at 11:31
  • @drorb: Thank you for quick reply. So the bowerrc file located @ `%APPDATA%/bower/config` will get the highest preference & it will overwrite any duplicate entry ? – SharpCoder Jan 15 '15 at 07:41
  • @SharpCoder actually the other way around. The file at %APPDATA%/bower/config is the last in order – Dror Bereznitsky Jan 15 '15 at 07:59