ChatGPT解决这个技术问题 Extra ChatGPT

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

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


A
Anmol

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

https://twitter.com/bower/status/918073147789889536

https://gist.github.com/sheerun/c04d856a7a368bad2896ff0c4958cb00


Just to be clear for those who don't read closely: updating bower is the preferred solution: npm install -g bower
It's weird that they deprecated this registry nine months ago, and I don't recall ever seeing any warnings when I ran bower until today, when things started 502'ing
Upgrading bower to latest (1.8.4) didn't fix it for me. However, adding a .bowerrc worked like a charm (at least until we're able to migrate away).
Same problem for me like @Brian described. This saved my day. Guess its time to update this old project to yarn eventually -.-
This is the better solution because updating the version of bower is not always possible in a project with multiple dependencies.
t
tkarls

Simplest solution is to just upgrade bower to latest version

If installed via NPM:

npm i -g bower

Didn't work. I ended up at latest Bower (1.8.4) but problem persisted. See other suggestion about .bowerrc
That is pretty strange since I did the exact same thing yesterday and got the same version 1.8.4 which did resolve the problem. And is also what bower themselves recommend. Perhaps something else is a problem in your setup so you're not running the bower that you think you are
I am also running at 1.8.4 and am still getting the message. The workaround above works, but it would be nice to get it fixed so the default points to the new registry.
upgrading bower in a large complex and aged project is far far far from the simplest solution..
If you are working on a project that someone else set up, then bower may be installed locally, in which case updating the global version will not help.
N
Nayas Subramanian

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"
  }

L
Le Hoai Duc

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 :)


t
territorial

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