【发布时间】:2020-10-31 09:03:09
【问题描述】:
我正在尝试在我的 Windows 上安装颤振,当我在 cmd 上键入颤振医生时出现错误,然后它退出 cmd 且没有错误消息,我尝试在 git batch 上编写颤振医生我收到此错误消息
Checking Dart SDK version...
The term 'Unblock-File' is not recognized as the name of a cmdlet, function, sc
ript file, or operable program. Check the spelling of the name, or if a path wa
s included, verify that the path is correct and try again.
At line:1 char:13
+ Unblock-File <<<< -Path 'C:\flutter/bin/internal/update_dart_sdk.ps1'; & 'C:
\flutter/bin/internal/update_dart_sdk.ps1'; exit $LASTEXITCODE;
+ CategoryInfo : ObjectNotFound: (Unblock-File:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Flutter requires PowerShell 5.0 or newer.
See https://flutter.dev/docs/get-started/install/windows for more.
Current version is 2.
我已经用这个值创建了变量名路径
C:\Windows\System32;C:\Program Files\Git\git-
cmd.exe;C:\flutter\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program
Files\Git\bin\git.exe;C:\Program Files\Git\cmd
【问题讨论】:
-
它明确指出:Flutter 需要 PowerShell 5.0 或更高版本。有关更多信息,请参阅flutter.dev/docs/get-started/install/windows。当前版本是 2。 您可能想安装 PowerShell Core 并尝试一下。
-
另外,PATH 环境变量应该包含文件夹的路径,而不是可执行文件
git.exe的完整路径和文件名 -
从技术上讲,您还破坏了
Path变量,因为您已从中删除了默认位置,例如C:\Windows和C:\Windows\System32\Wbem。 -
@iRon 你可以在 Windows 7 上运行 5.1。
标签: android powershell android-studio flutter dart