yarn 安装报错error Error: certificate has expired

先报错error Error: connect ETIMEDOUT 104.16.24.34:443

然后把下载源设置成淘宝的

先把node-sass镜像源进行设置成国内的

yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass

然后将资源地址设置为淘宝镜像

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

记得查看一下自己是否更改成功

yarn config get registry

然后又报错error Error: certificate has expired

查看配置:

yarn config list

配置信息:

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/v14.17.6 win32 x64',
  electron_mirror: 'https://cdn.npm.taobao.org/dist/electron/',
  lastUpdateCheck: 1706058730643
}

yarn config set strict-ssl false     将 'strict-ssl'设为false

设置后运行yarn,安装成功

你可能感兴趣的:(yarn,前端,javascript)