yarn:error Error: certificate has expiredERR_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 expiredat 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"},