yarn:error Error: certificate has expired&ERR_OSSL_EVP_UNSUPPORTED解决

yarn:https://registry.npm.taobao.org failed, reason certificate has expired

npm config set registry https://registry.npmmirror.com 【推荐】

yarn:error Error: certificate has expired

  • 报错
error Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
    at TLSSocket.emit (node:events:519:28)
    at TLSSocket._finishInit (node:_tls_wrap:1078:8)
    at ssl.onhandshakedone (node:_tls_wrap:864:12)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command
  • 解决方案
yarn config set "strict-ssl" false -g

yarn start:ERR_OSSL_EVP_UNSUPPORTED’

  • 报错
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
  • 解决方案

在 package.json 里的脚本命令加入 --openssl-legacy-provider 参数,解决了。

"scripts": {
    "start": "react-app-rewired --openssl-legacy-provider start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-scripts eject",
    "gh-pages": "react-app-rewired build && gh-pages -d build"
  },
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值