Why is Bower returning a 410 error message? - bower

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.

Related

Unable to use rsocket-tcp-client package

I would like to enable client my to reconnect to my server in case the server restarts. I am trying thus the following piece of code. The thing is, after adding this line "rsocket-tcp-client": "^0.0.23" to my package.json and after running $npm install && ng update && ng serve I got the following error message :
Error: ./node_modules/rsocket-tcp-client/build/RSocketTcpClient.js
Module not found: Error: Can't resolve 'net' in '/Users/gitter/myproject/node_modules/rsocket-tcp-client/build'
Error: ./node_modules/rsocket-tcp-client/build/RSocketTcpClient.js
Module not found: Error: Can't resolve 'tls' in '/Users/gitter/myproject/node_modules/rsocket-tcp-client/build'
Any help please will be more than welcome.
You need to install tls and net packages as well if you are going to use that sample code.

Bower using old registry instead of new

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

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.

Resources