EINVRES Request to https://bower.herokuapp.com/packages/ failed with 502

JavascriptBower

Javascript Problem Overview


Bower install fails with 502 - Bad Gateway when downloading bower packages.

For example bower install for ember library gives following response in command line.

> EINVRES Request to https://bower.herokuapp.com/packages/ember failed > with 502

When http://bower.herokuapp.com/ is accessed directly from URL it gives the following message.

> This Bower version is deprecated. Please update it: npm install -g > bower. The new registry address is https://registry.bower.io

Javascript Solutions


Solution 1 - Javascript

Bower is deprecating their registry hosted with Heroku. http://bower.herokuapp.com/ Will not be accessible anymore or it might be down intermittently, therefore, forcing users to a new registry.

Users working on old bower versions can update the .bowerrc file with the following data.

{
  "registry": "https://registry.bower.io"
}

.bowerrc file can be located at the same folder where bower.json and bower_components folder is located. If it is not present already, you can make one.

For references check the below links

Solution 2 - Javascript

Simplest solution is to just upgrade bower to latest version

If installed via NPM:

npm i -g bower

Solution 3 - Javascript

When using asp.net core then should change something like this. bowerrc.json you can find inside project folder.

  {
     "registry": "https://registry.bower.io",
     "directory": "wwwroot/lib"
  }

Solution 4 - Javascript

If you use windows to install npm, You must run "Node.js command prompt" with administrator and run this command: npm i -g bower. I tried and worked :)

Solution 5 - Javascript

echo '{"registry": "https://components.bower.io","directory": "wwwroot/lib"}' > .bowerrc

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNithin BabyView Question on Stackoverflow
Solution 1 - JavascriptNithin BabyView Answer on Stackoverflow
Solution 2 - JavascripttkarlsView Answer on Stackoverflow
Solution 3 - JavascriptNayas SubramanianView Answer on Stackoverflow
Solution 4 - JavascriptLe Hoai DucView Answer on Stackoverflow
Solution 5 - JavascriptterritorialView Answer on Stackoverflow