Dart 安裝錯誤"Error: Failed to download resource "dart""解決


brew 安裝dart

利用brew 安裝dart時用以下兩個命令:

$ brew tap dart-lang/dart
$ brew install dart

第二個命令報以下錯誤,大概意思是在官網下載SDK時失敗。

brew install dart
==> Installing dart from dart-lang/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release
-=O=-                                      #     #     #    #                 
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to storage.googleapis.com:443 
Error: Failed to download resource "dart"
Download failed: https://storage.googleapis.com/dart-archive/channels/stable/release/2.8.4/sdk/dartsdk-macos-x64-release.zip``      

解決方法

思路:利用其它方法下載安裝包,放到brew的包緩存目錄然后在利用 $ brew install dart 命令安裝

1、利用迅雷,或者瀏覽器下載安裝包,地址就是錯誤日志里的鏈接
https://storage.googleapis.com/dart-archive/channels/stable/release/2.8.4/sdk/dartsdk-macos-x64-release.zip
2、下載好把zip文件拷貝到 **/Users/wjw/Library/Caches/Homebrew/downloads ** 目錄下
3、執行安裝命令,Xcode 需要11.5+

 brew install dart
Updating Homebrew...
==> Installing dart from dart-lang/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release
######################################################################## 100.0%
Warning: Your Xcode (11.3) is outdated.
Please update to Xcode 11.5 (or delete it).
Xcode can be updated from the App Store.

==> Caveats
Please note the path to the Dart SDK:
  /usr/local/opt/dart/libexec
==> Summary
🍺  /usr/local/Cellar/dart/2.8.4: 502 files, 486MB, built in 10 seconds

這樣就安裝好了

$ dart --version                               
Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on "macos_x64"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM