cmd上的'flutter doctor'命令不起作用

时间:2020-04-05 23:24:52

标签: flutter dart

我尝试运行的所有flutter命令都显示

Checking Dart SDK version...
Downloading Dart SDK from Flutter engine af51afceb8886cc11e25047523c4e0c7e1f5d408...
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\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

Error: Unable to update Dart SDK. Retrying...

Waiting for 1 seconds, press CTRL+C to quit ...
Terminate batch job (Y/N)?

我已经学习颤振了3个月了,效果很好。任何建议如何解决此问题

3 个答案:

答案 0 :(得分:0)

看起来是一个已知问题。您可以检查链接吗? https://github.com/flutter/flutter/issues/27276

答案 1 :(得分:0)

我有同样的问题。我下载了flutter SDK。如果看不到“ flutter_windows_v1.12.13 + hotfix.9-stable.zip”按钮,则需要使用免费的VPN扩展。启用VPN后,您可能会看到此“ flutter_windows_v1.12.13 + hotfix.9-stable.zip”按钮。下载并解压缩flutter SDK。设置环境变量。

这就是我解决问题的方式,希望这对您有用。

答案 2 :(得分:0)

启动您的VPN并重置控制台可能无法从您的国家IP访问URI, 我的问题通过此解决方案解决