yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

Error: certificate has expired #9032

Open bmacher opened 4 months ago

bmacher commented 4 months ago

Hi, yarn fails in my GitHub actions and I don't find any information how to fix it. This is what I get:

Run yarn install --frozen-lockfile
yarn install v1.22.21
[1/4](https://github.com/bmacher/macher.dev/actions/runs/7752883488/job/21214882066#step:6:5)] Resolving packages...
[2/4] Fetching packages...
error Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1[5](https://github.com/bmacher/macher.dev/actions/runs/7752883488/job/21214882066#step:6:6)39:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:[7](https://github.com/bmacher/macher.dev/actions/runs/7752883488/job/21214882066#step:6:8)34:[12](https://github.com/bmacher/macher.dev/actions/runs/7752883488/job/21214882066#step:6:13))
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Process completed with exit code 1.

Please can anyone help? :-)

panjf2000 commented 4 months ago

I ran into this issue today, and it seems to be recent and there is still no answer to it.

While waiting for the official team to fix this, there is a temporary solution: yarn config set strict-ssl false

CrawfordAndWood commented 4 months ago

I've just run into this: Running command yarn install yarn install v1.22.21 [1/4] Resolving packages... [2/4] Fetching packages... error Error: certificate has expired

Thanks to panjf2000 for the suggestion, I'll see about trying that if it doesn't magically resolve soon.

MythicManiac commented 3 months ago

Also running into this

MythicManiac commented 3 months ago

In our case the problem was a npm registry proxy that was pinned in yarn.lock was no longer available, and the fix was to change the registry that's pinned. You can regenerate the resolved registry by deleting the resolved lines from yarn.lock and running yarn install again.

undermoodzyx commented 3 months ago

Same for me. The node version I'm using is v20.11.0. However, after switching node to v16.xx, yarn works normally.

RiverCui commented 3 months ago

I ran into this issue today, and it seems to be recent and there is still no answer to it.

While waiting for the official team to fix this, there is a temporary solution: yarn config set strict-ssl false

It works, thank u!

hzz780 commented 2 months ago

rm yarn.lock yarn

this one is ok for me

Et7f3 commented 2 months ago

rm yarn.lock yarn

Based on @MythicManiac you can do sed -i /resolved/d yarn.lock instead (it worked for me).

zoujiawei6 commented 3 weeks ago

yarn config set registry "https://registry.npm.taobao.org" ×

修正后(After correction):

yarn config set registry "https://registry.npmmirror.com" √