windows - FVM/Flutter 无法在 Windows 上的非管理员帐户上找到 git

标签 windows flutter git

作为管理员,fvm 可以工作:

PS C:\WINDOWS\system32> fvm flutter --version
Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c07f788888 (3 days ago) • 2023-02-22 17:52:33 -0600
Engine • revision 0f359063c4
Tools • Dart 2.19.2 • DevTools 2.20.1

当我尝试从我的用户帐户运行它时,它没有运行,即使它显然在我的路径中:

C:\Users\saxto>fvm flutter --version
Error: Unable to find git in your PATH.
C:\Users\saxto>where.exe git
C:\Program Files\Git\cmd\git.exe

[![Screenshot of my PATH environment variable][1]][1]
[1]: /image/Zfanx.png

最佳答案

这是 flutter 中的一个错误。 git 实际上在路径中,但是当它运行时,它会产生一个有关存储库所有权可疑的错误:

PS C:\Users\saxto\fvm\versions\stable> git rev-parse HEAD
fatal: detected dubious ownership in repository at 'C:/Users/saxto/fvm/versions/stable'
'C:/Users/saxto/fvm/versions/stable' is owned by:
        'XXX'
but the current user is:
        'YYY'
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/saxto/fvm/versions/stable

可以通过运行错误消息中推荐的命令来修复此问题。已在此处提交问题:https://github.com/flutter/flutter/issues/121488

关于windows - FVM/Flutter 无法在 Windows 上的非管理员帐户上找到 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75567961/

相关文章:

c++ - 什么会导致单写/多读锁的死锁?

linux - flutter run 无法访问我的辅助硬盘的文件

Flutter http 对象主体列表

windows - 使用 eclipse 从 git 存储库下载源代码?

python - 确定当前用户是否在管理员组中(Windows/Python)

windows - VBA - 未定义用户定义类型

android - 任务 ':app:desugarDebugFileDependencies' 执行失败

git - Git-encrypt 中的错误加密实践?

git - 在子目录中 merge git 存储库

git - 如何检查 HEAD 是否被标记