Instantly share code, notes, and snippets.

@sheerun /.bowerrc
Last active Oct 22, 2018

Embed
What would you like to do?
Proper .bowerrc file pointing to new Bower registry (if using legacy Bower version)
{
"registry": "https://registry.bower.io"
}
@sheerun

This comment has been minimized.

Owner

sheerun commented Oct 11, 2017

Why deprecate old registry url? The current domain of registry hardcored into Bower (https://bower.herokuapp.com) belongs to Heroku. It means we have no control over it and that presents at least two serious disadvantages:

  1. We're dependent on Heroku for hosting of the registry (currently they kindly provide us with credits but we can't expect it forever)
  2. We are unable to change DNS of this domain to, for example, put it behind CDN for reduced costs and latency.

To fix this, we released patches for each Bower version that change registry url to https://registry.bower.io It's enough to upgrade.

In case someone is unable to upgrade Bower (not recommended), the .bowerrc file presented above needs to be added to a project.

@mbrodala

This comment has been minimized.

mbrodala commented Oct 11, 2017

You really should set up a redirect from the old to the new host, this is a really hard breaking change.

@MikeN123

This comment has been minimized.

MikeN123 commented Oct 11, 2017

:') welcome to the javascript world

@Bigtalljosh

This comment has been minimized.

Bigtalljosh commented Oct 11, 2017

A redirect and notice wouldn't have gone amiss. Our builds are now failing because we were unaware of this change.

@sfanetti

This comment has been minimized.

sfanetti commented Oct 11, 2017

Its a good thing there was a lot of warning and deprecation notices in the console leading up to this. :P

@ka4a

This comment has been minimized.

ka4a commented Oct 11, 2017

We also have this problem
bower jquery#2.1.4 EINVRES Request to https://bower.herokuapp.com/packages/jquery failed with 410

@thrinay

This comment has been minimized.

thrinay commented Oct 11, 2017

Thank god, you said this. My builds eventually fail and I have no idea why they did. But Thanks though

@justin-john

This comment has been minimized.

justin-john commented Oct 11, 2017

This is really hard figure it out what happen in build failing. Please try to put additional warning or notices.

@cspray

This comment has been minimized.

cspray commented Oct 18, 2017

In my CI environment I'm installing Bower 1.8.2, the latest version according to the GH repo, and I am still getting 410 errors. The only thing that fixed this for me was manually setting the registry in .bowerrc.

@ludamillion

This comment has been minimized.

ludamillion commented Oct 18, 2017

😒

@jgillick

This comment has been minimized.

jgillick commented Oct 18, 2017

I was still getting the 410 errors and here's the road to my solution. TL;DR: I think it was nvm's fault, reenable your node version.

  • I upgraded bower using npm upgrade -g bower
  • Then I verified the version was 1.8.2 with bower -v
  • When I ran bower install it still gave me 410 errors.
  • When I ran it with verbose output bower install -V the end of the output showed as it was still using version 1.7.9.
  • Running which bower would show the path to the correct version.
  • It seems like nvm might be doing something wonky behind the scenes.
  • The way I solved it:
    • Re-source bash settings: source ~/.bash_profile
    • Remind nvm which version of node to use: nvm use 5.12.0 (I know I'm a bit behind)
    • Clear cache: bower cache clean
    • Try again: bower install
    • Success, have a beer.

Your milage may vary.

@AditMulyadi

This comment has been minimized.

AditMulyadi commented Jun 26, 2018

Hello,
I found this error message when i run bower install on circleci

bower EINVRES       Request to https://bower.herokuapp.com/packages/jquery failed with 502
bower install returned exit code 1

anyone knows the problem why? Is how to fix it the same as above problem ?
Thanks

@fredimachado

This comment has been minimized.

fredimachado commented Jun 26, 2018

Hi @AditMulyadi,
We got the same error yesterday, and updating the registry, as suggested in this Gist, fixed the issue.
Cheers!

@bjendyk

This comment has been minimized.

bjendyk commented Jun 26, 2018

My builds were also failing because of bower.herokuapp.com being down since yesterday. I confirm that setting the registry as suggested in this gist fixes the problem. Thanks :) 👍

@nnrudakov

This comment has been minimized.

nnrudakov commented Jun 27, 2018

How to update registry if I'm not using bower at all (I have no .bowerrc) but it needs for framework?

@insprintorob

This comment has been minimized.

insprintorob commented Jun 28, 2018

The other option here is to just move your dependencies to npm or yarn

@sheerun

This comment has been minimized.

Owner

sheerun commented Jun 28, 2018

You can use bower-away to switch to yarn and preserve the rest of your setup

@ParsaGachkar

This comment has been minimized.

ParsaGachkar commented Jun 29, 2018

my .bowerrc looks like this
{
"directory": "wwwroot/lib",
"registry": "https://registry.bower.io"
}
still can't install or update anything "Using Visual Studio 2018 in a dotnet core 2.0 web application project "

Gonna give a try with VSCode and CLI

@abepetrillo

This comment has been minimized.

abepetrillo commented Jul 27, 2018

The newest version of bower really should point to the new registry by default, not the old one. Without this thread I would have been lost. Thanks @sheerun

@DanielRuf

This comment has been minimized.

DanielRuf commented Sep 26, 2018

Should have been also in the deprecation notices probably ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment