前言:
最近準備開發(fā)Flutter項目時,在安裝環(huán)境時,安裝Homebew時遇到了以下報錯信息,在這里分享一下。
報錯信息:
~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
fatal: unable to access 'https://github.com/dart-lang/homebrew-dart/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Error: Failure while executing; `git clone https://github.com/dart-lang/homebrew-dart /opt/homebrew/Library/Taps/dart-lang/homebrew-dart --origin=origin --template= --config core.fsmonitor=false` exited with 128.
解決方案:
安裝 ARM 版 Homebrew
ARM版Homebrew最終被安裝在/opt/homebrew路徑下。
直接執(zhí)行:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
然后還需設置環(huán)境變量,具體操作步驟如下,一定要仔細閱讀。
在終端執(zhí)行命令echo $SHELL獲得終端類型:
/bin/zsh => zsh => .zprofile
/bin/bash => bash => .bash_profile
如果看到的是/bin/zsh執(zhí)行:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)" #brew.idayer.com' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
如果看到的是/bin/bash執(zhí)行:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)" #brew.idayer.com' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
從macOS Catalina(10.15.x) 版開始,Mac使用zsh作為默認Shell。
Homebrew 安裝成功~
~ % brew -v
Homebrew 4.1.7
然后繼續(xù)執(zhí)行
brew tap dart-lang/dart
brew install dart
提示安裝失敗
~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
error: RPC failed; curl 35 LibreSSL SSL_read: Operation timed out, errno 60
fatal: expected flush after ref listing
Error: Failure while executing; `git clone https://github.com/dart-lang/homebrew-dart /opt/homebrew/Library/Taps/dart-lang/homebrew-dart --origin=origin --template= --config core.fsmonitor=false` exited with 128.
再次執(zhí)行效果:
~ % brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
remote: Enumerating objects: 3684, done.
remote: Counting objects: 100% (1438/1438), done.
remote: Compressing objects: 100% (437/437), done.
remote: Total 3684 (delta 1185), reused 1199 (delta 995), pack-reused 2246
Receiving objects: 100% (3684/3684), 671.61 KiB | 54.00 KiB/s, done.
Resolving deltas: 100% (2461/2461), done.
Tapped 22 formulae (53 files, 857.5KB).
安裝成功啦!?。?!
然后安裝
~ % brew install dart
==> Fetching dart-lang/dart/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.
############################################ 54.8%curl: (56) LibreSSL SSL_read: Connection reset by peer, errno 54
Error: dart: Failed to download resource "dart"
Download failed: https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.0/sdk/dartsdk-macos-arm64-release.zip
又出現(xiàn)報錯信息了
那我們再次嘗試一下呢
這次就很快安裝成功了
brew install dart
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api/formula.jws.js
##O#- #
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api/cask.jws.json
##O#- #
==> Fetching dart-lang/dart/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/3.1.
################################################################################# 100.0%
==> Installing dart from dart-lang/dart
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences.
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 14.2.
==> Caveats
Please note the path to the Dart SDK:
/opt/homebrew/opt/dart/libexec
==> Summary
?? /opt/homebrew/Cellar/dart/3.1.0: 987 files, 554.3MB, built in 6 seconds
==> Running `brew cleanup dart`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
安裝環(huán)境的時候和網(wǎng)絡也有一定的關(guān)系,我們可以多試兩次
我們我們測試一下安裝成功沒文章來源:http://www.zghlxwxcb.cn/news/detail-693050.html
~ % dart --version
Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "macos_arm64"
??????文章來源地址http://www.zghlxwxcb.cn/news/detail-693050.html
到了這里,關(guān)于Mac安裝Dart時,Homebrew報錯 Error: Failure while executing的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!