问题描述
执行yarn install时报错:
error Couldn't find package "fsevents@~2.3.2" required by "chokidar@^3.4.2" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
解决方案1
yarn --registry=https://registry.npmmirror.com
结果:无法解决问题,始终显示:
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
解决方案2
rm yarn.lock
yarn cache clean
yarn install
在yarn install时再次遇到问题:
[1/4] Resolving packages...
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/install for documentation about this command.
执行以下命令:
yarn config set strict-ssl false
再次执行yarn install,成功。