While building a docker container, I came across this error
Step 6/17 : RUN bower install --allow-root ---> Running in 20f9229dcd1e bower angular-touch#~1.5.0 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular-touch failed: certificate has expired
Building this image was working fine for about 2 years, then suddenly refused to cooperate.
How can I refresh a missing certificate?
4
Answers
In my case i just add two lines into .bowerrc file
This is workaround, and it's bad practice. But using bower and outdated plugins is also bad practice
I am getting these error since yesterday.
I solved it like following:
if you have your dependencies in bower.json like that:
then change it to:
with your specified version and git url.
You will find the git url of all bower packages here: https://registry.bower.io/packages
You are probably all using a "very old" build stack based on older node docker images, which use older Debian distribution for its base image (i.e.
node:6
=> Debian Stretch).It seems that the letsencrypt certificate of registry.bower.io was updated yesterday (April 24th, 2023) and now uses a more modern intermediate certificate. This was not available/known in older Debian distributions.
Of course its about time to upgrade your stack, but in the meanwhile you could add this to your Dockerfile, just before you are doing the
bower install
as a workaround:Then use this flag to tell bower to use the system wide CA system:
bower install
still works for newer versions of node.From what I noticed, the certificate stopped working for the version 6, 7 and 8.
As a workaround: only
bower install
command I execute on the newer node (for example 12), and the rest of the commands for building the project I execute on the version I need.It worked in our project.