Dartインストールエラー"Error:Failed to download resource"dart""解決

1900 ワード

brewインストールdart


brewを使用してdartをインストールする場合は、次の2つのコマンドを使用します.
$ brew tap dart-lang/dart
$ brew install dart

2番目のコマンドは以下のエラーを報告し、公式サイトで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.zip2、ダウンロードして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"