如,我给一个项目用yarn装依赖,这时候报错:
yarn install v1.22.21 info No lockfile found. [1/4] Resolving packages... error Error: certificate has expired at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34) at TLSSocket.emit (node:events:513:28) at TLSSocket._finishInit (node:_tls_wrap:953:8) at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12) info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
关键信息:error Error: certificate has expired(错误错误:证书已过期)
好了,回想一下我给yarn用的是淘宝的镜像源链接:https://registry.npm.taobao.org
然后我在浏览器打开该链接,发现该链接的证书过期了
抱着试一试的态度,把https改成了http,再次切换镜像源:
yarn config set registry http://registry.npm.taobao.org
然后,重新在项目中用yarn拉取项目,就可以了。
标签:node,http,证书,yarn,已过期,https,链接 From: https://www.cnblogs.com/iuniko/p/17989546