Bower using old registry instead of new - bower

My bower has just started giving errors when I do a grunt build. In particular, I am seeing errors like:
Warning: Request to https://bower.herokuapp.com/packages/angular failed with 502 Use --force to continue.
Doing some research, it looks like the registry server has changed from bower.herokuapp.com to registry.bower.io. However, my bower is still hitting the old server.
My bower is updated to the latest version: 1.8.4.
I've cleared my bower cache, just in case.
Not sure what to do next.
UPDATE:
I was able to specify the registry locally in my .bowerrc file, but I would still like to know how to get it to hit the new registry by default.
{
"directory": "app/bower_components",
"registry": {
"search": [
"https://registry.bower.io"
]
}
}

Related

Why is Bower returning a 410 error message?

Recently my bower tasks have been failing and returning a 410 error message like below:
2017-10-11T13:22:21.2226829Z bower angular-cookies#v1.6.7-build.5456+sha.3651e42
EINVRES Request to https://bower.herokuapp.com/packages/angular-cookies failed with 410
2017-10-11T13:22:21.2706832Z ##[error]Bower failed with error: C:\NPM\Modules\bower.cmd failed with return code: 1
I haven't actually changed anything in this project I'm just spinning up a new instance in a test slot. Does anyone know why this has started happening?
This is because bower has changed the registry url today without a redirect.
The preferred method is to update bower:
npm upgrade -g bower
However if you are unable to do so for whatever reason you can edit your .bowerrc file to include this to point to the new url.
{
"registry": "https://registry.bower.io"
}
You need upgrade your bower.
npm upgrade -g bower
Please take a look for upgrade solutions here.

Registering a Bower Package with Remote Repository in Artifactory isn't saving

Having some trouble registering a bower package to a remote repository which should be possible with the version I have (artifactory.version: 4.9.1)
So there is a repo there thats setup and it has a URL of http://mygetserver.domain.com/git which hits the gitolite page for browsing the git repos (which seems odd)
The registry url is pointing at the default of https://bower.herokuapp.com/
With the Bower Settings pointing to Custom and a default URL of {0}/{1}/archive/{2}.{3} - Again that feels weird but I have no idea whats expected in there
So when I try and register a package with
bower register nh-styles git#mygetserver.domain.com:nh-styles.git --verbose
I get an error to say
Error: Unknown error: 404 - Unable to determine coordinates from url git#mygetserver.domain.com:nh-styles.git
If I change that to use ssh:// first then it works
C:\Dev>bower register nh-styles
ssh://git#mygetserver.domain.com/nh-styles.git --verbose bower
nh-styles#* resolve
ssh://git#mygetserver.domain.com/nh-styles.git#* bower nh-styles#*
checkout v0.0.4 bower nh-styles#* old-git It seems you
are using an old version of git, it will be slower and propitious to
errors! bower nh-styles#* invalid-meta nh-styles is missing
"ignore" entry in bower.json bower nh-styles#* resolved
ssh://git#mygetserver.domain.com/nh-styles.git#0.0.4 ? Registering a
package will make it installable via the registry
(http://myart.artifactorydomain.com:8081/artifactory/api/bower/bower-nh-git
? Registering a package will make it installable via the registry
(http://myart.artifactorydomain.com:8081/artifactory/api/bower/bower-nh-git
), continue? Yes bower nh-styles register
ssh://git#mygetserver.domain.com/nh-styles.git
Package nh-styles registered successfully! All valid semver tags on
ssh://git#mygetserver.domain.com/nh-styles.git will be available as
versions. To publish a new version, just release a valid semver tag.
Run bower info nh-styles to list the available versions.
C:\Dev>bower info nh-styles bower nh-styles#* not-cached
art://nh-styles/nh-styles#* bower nh-styles#* resolve
art://nh-styles/nh-styles#* bower EREQUEST
Request to
http://myart.artifactorydomain.com:8081/artifactory/api/bower/bower-nh-git/refs/nh-styles/n
h-styles returned 404 status code.
Additional error details: [object Object]
Yet when I try and Info nothing shows. Every time I resubmit I'm getting a 201 rather than a package exists issue. So basically why is it not being saved? Artifactory logs are showing nothing I can see. Anything else I can look at?
The reason you must include ssh:// is that the bower resolver need to know what protocol it has to use when accessing the specified url, this is also documented here. Also I noticed you used domain.com:nh-styles.git this is not a valid url, because of the : -- it might also work like this without the ssh:// part i'm not sure.
The way registering a package with Artifactory works is that it simply acts as the registry in a sense that it simply keeps a mapping of the package name to the git url you gave it. That's also why registering a package will have no other apparent effect (except for the 201 response).
The behavior is pretty much identical to the bower public registry in this aspect.
The error itself you're getting is because Artifactory can't find the git repo you're referring to in the registered git repository - check that the repo at the url you gave is accessible - you can also turn on debug logs on org.artifactory.addon.bower to see the exact error Artifactory encountered if it's not already printing something to the log about this.

Bower install from URL gives blank folder

I'm using bower (v. 1.3.5) to pull in my Front-End JS dependencies, and I want to depend on this: https://github.com/dcneiner/Downloadify
It doesn't have its own bower.json so I'm referencing by URL in MY bower.json:
"dependencies": {
"jspdf": "~1.0.272",
"downloadify": "https://github.com/dcneiner/Downloadify.git"
}
But all I get is the named folder containing only a .bower.json file, but none of the code or anything else in the GH repo.
Running bower install directly on the cmd line gave (once I'd cleared out the bower cache):
E:/My/Path>bower install https://github.com/dcneiner/Downloadify.git
bower Downloadify#* not-cached https://github.com/dcneiner/Downloadify.git#*
bower Downloadify#* resolve https://github.com/dcneiner/Downloadify.git#*
bower Downloadify#* checkout 0.2.1
bower Downloadify#* resolved https://github.com/dcneiner/Downloadify.git#0.2.1
bower Downloadify#~0.2.1 install Downloadify#0.2.1
I previously did the same thing with jQuery.fileDownload which worked perfectly, so I don't think it's anything I've done to my machine?
QUESTION:
Have I done something wrong?
Has Downloadify been set up wrong?
Or is it an inexplicable mystery?
In either of the first 2 cases, what is the problem and how do I fix it?
NOTE: Currently I'm working around it by having downloaded the source code manually and having it hard-coded into my project.

Bower install CERT_UNTRUSTED Error

I got the CERT_UNTRUSTED when I tried to run bower install command to install components.
For example, I got this error when I ran the following:
bower install bootstrap-sass-official --save
The output was:
bower error Request to https://bower.herokuapp.com/packages/bootstrap-sass-official failed: CERT_UNTRUSTED
Note: This is not a package specific error. This happens when you try to install any package, not just with bootstrap-sass-official.
you can try setting this in .bowerrc:
{
"directory": "bower_components",
"registry": "http://bower.herokuapp.com",
"strict-ssl": false
}
I found a quick fix for this issue. I guess the issue is happening because of my company's SSL settings.
I changed the registry search as follows (in my windows laptop) and it fixed the issue.
set registry.search=http://bower.herokuapp.com
This should work in unix systems as well, where you have to create a env variable with above key and value.
You can also change the registry setting at .bowerrc file.
You can follow as a quick and dirty fix. Do not make it as a permanent solution.

Bower install - failed with ETIMEDOUT

When I run bower install, I get the following error:
Request to https://bower.herokuapp.com/packages/jquery failed with
ETIMEDOUT,
retrying in 1.8s
But when I run the same URL in the address bar of Chrome, I get the json. I don't know why it fails when I do bower install using Windows 7 command shell. I suspect it has got something to do with my workplace's proxy settings.
Anyone?
Try edit .bowerrc
"proxy":"http://<host>:<port>",
"https-proxy":"http://<host>:<port>",
"strict-ssl": false
Have you tried something like http_proxy='proxyserver' https_proxy='proxyserver' bower install? (where proxyserver is your proxy)
Getting error related to proxy when no proxy is configured: May be npm is picking up proxy.
Delete the proxy attribute from npm config and try. Use:
npm config delete proxy
This solved my problem.
You need to set the new registry for bower in .bowerrc:
{
"registry": "https://registry.bower.io"
}
The old url https://bower.herokuapp.com/ is no more available.
In my case (Win7), this problem was fixed by providing bower with the proxy settings.
As #Robert Moon mentioned in his answer, you can place this settings in the .bowerrc file.
For proxies that require authentication you will need to provide it as follows:
http://domain\username:password#proxyserverurl:port
The back slash is particularly tricky since it needs to be escaped in the .bowerrc file
Example .bowerrc:
{
"directory": "bower_components",
"proxy": "http://domain%5Cusername:password#proxyserverurl:port",
"https-proxy": "http://domain%5Cusername:password#proxyserverurl:port",
"no-proxy":"localserver.domain.com"
}
The official documentation from Bower that mentions proxy settings:
https://bower.io/docs/config/#bowerrc-specification
I was also stuck with the same error. The following steps fixed the error for me:
Remove any existing proxy: npm config delete proxy
Then set proxy using: npm config set proxy http://<host>:<port>
You may also need to change the proxy settings for git:
git config --global http.proxy http://<host>:<port>
Now edit the .bowerrc file as described by Robert Moon
"proxy":"http://<host>:<port>",
"https-proxy":"http://<host>:<port>",
"strict-ssl": false
Prod server build bower well, but the develop server does not build, it is stop with ETIMEDOUT.
The error went through when I added:
"timeout": 120000
into .bowerrc.
Info from page https://bower.io/docs/config/ helped me.

Resources