在 Win11 上安装 Flutter - 运行“flutter doctor”时出错

问题描述 投票:0回答:1

我通过从官方网站下载 zip 文件安装了 flutter,当尝试运行“flutter doctor”时,我不断收到错误。

冲洗之前的第一个错误“flutter pub get in flutter_tools:

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

下一个错误:

Failed to find the latest git commit date: VersionCheckError: Command exited with code 128: git -c
log.showSignature=false log HEAD -n 1 --pretty=format:%ad --date=iso
Standard out:
Standard error: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Returning 1970-01-01 01:00:00.000 instead.

医生总结中的颤动错误:

[!] Flutter (Channel unknown, 0.0.0-unknown, on Microsoft Windows [Version 10.0.22621.1105], locale en-DK)
    ! Flutter version 0.0.0-unknown on channel unknown at C:\Users\USERNAME\AppData\Local\flutter
    ! Upstream repository unknown

颤动路径: C:\Users\USERNAME\AppData\Local lutter in

系统环境变量: 用户变量 -> 路径 -> “C:\Users\USERNAME\AppData\Local lutter in”

Flutter Doctor 接受所有其他部分,例如 android 工具链、android studio ... 到目前为止我还没有找到解决方案,非常感谢任何帮助。

windows flutter installation
1个回答
0
投票

问题出在官方页面上的安装包 flutter_windows_3.3.10-stable.zip 文件中。 使用 git 克隆最新的稳定版本,而不是在所选的安装目录中运行以下代码:

git clone https://github.com/flutter/flutter.git -b stable

现在运行“flutter doctor”不会出现错误。

© www.soinside.com 2019 - 2024. All rights reserved.