显示错误:
Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At C:\src\flutter\bin\internal\update_dart_sdk.ps1:68 char:5
+ Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
请,我需要新手帮助。
答案 0 :(得分:1)
答案 1 :(得分:0)
首先在终端中运行:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
然后在我的MAC中成功下载dart sdk。
您必须在环境中添加PUB_HOSTED_URL=https://pub.flutter-io.cn
和&FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
。
再试一次。
答案 2 :(得分:0)
使用VPN并尝试再次运行命令。它对我有用。
答案 3 :(得分:-1)