HomeBrew 安裝 yarn 1.6.0 版本失敗

weixin_33766168發表於2018-05-11

錯誤程式碼:curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

==> Downloading https://yarnpkg.com/downloads/1.6.0/yarn-v1.6.0.tar.gz
==> Downloading from https://github.com/yarnpkg/yarn/releases/download/v1.6.0/yarn-v1.6.0.tar.gz
###########################                                               38.6%
curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
######################################################################## 100.0%
curl: (7) Failed to connect to github-production-release-asset-2e65be.s3.amazonaws.com port 443: Operation timed out
Error: Failed to download resource "yarn"
Download failed: https://yarnpkg.com/downloads/1.6.0/yarn-v1.6.0.tar.gz

原因應該是 curl 有問題,將 homebrew 源切換成中科院的源也無法解決問題!

最後找到一種方式解決了,在 Mac 終端輸入如下命令:

$ git config --global core.compression -1

然後重新安裝 yarn(由於電腦安裝了 node,所以帶上 --without-node 引數)

$ brew install yarn --without-node
==> Downloading https://yarnpkg.com/downloads/1.6.0/yarn-v1.6.0.tar.gz
==> Downloading from https://github.com/yarnpkg/yarn/releases/download/v1.6.0/yarn-v1.6.0.tar.gz
######################################################################## 100.0%
?  /usr/local/Cellar/yarn/1.6.0: 14 files, 4.1MB, built in 4 minutes 58 seconds

相關文章