yarn 报错 certificate has expired
## 简介 一些 `yarn` 操作会报错: ```sh error Error: certific
渲染中...
## 简介
一些 `yarn` 操作会报错:
```sh
error Error: certificate has expired
at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket._finishInit (node:_tls_wrap:959:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12)
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
```
<!-- more -->
## 临时解决
- 关闭 `ssl`
```sh
yarn config set strict-ssl false
```
## 其他
查看 `yarn` 配置:
- 运行:`yarn config list` 可以看到如下信息
```sh
yarn config v1.22.21
info yarn config
{
'version-tag-prefix': 'v',
'version-git-tag': true,
'version-commit-hooks': true,
'version-git-sign': false,
'version-git-message': 'v%s',
'init-version': '1.0.0',
'init-license': 'MIT',
'save-prefix': '^',
'bin-links': true,
'ignore-scripts': false,
'ignore-optional': false,
registry: 'https://registry.npm.taobao.org/',
'strict-ssl': true,
'user-agent': 'yarn/1.22.21 npm/? node/v18.14.0 win32 x64',
lastUpdateCheck: 1706248207836
}
info npm config
{
registry: 'https://registry.npm.taobao.org/',
python: 'C:\\Users\\xxhu1\\.windows-build-tools\\python27\\python.exe',
'strict-ssl': false
}
```
## 长期解决
**感谢网友评论解答!!!**
出现该问题的原因事淘宝镜像原地址 2024年1月22日 已过期,需要设置新的镜像:
```sh
yarn config set registry https://registry.npmmirror.com
```
END
评论
登录后查看和发表评论
前往登录