我的颤振遇到了问题,当我在命令“颤振医生”中写入时,我得到:
where' is not recognized as an internal or external command,
operable program or batch file.
Error: Unable to find git in your PATH.
然后当我以管理员身份运行命令并写下“flutter doctor”时:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.18362.1256], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] VS Code (version 1.56.2)
[☠] Connected device (the doctor check crashed)
X Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know
about this issue at https://github.com/flutter/flutter/issues.
X ProcessException: Failed to find "reg" in the search path.
Command: reg
! Doctor found issues in 1 category.
在android studio中我得到:
Error: PowerShell executable not found.
Either pwsh.exe or PowerShell.exe must be in your PATH.
我该怎么办?
当我在命令中写设置路径时,我得到了:
C:\Users\DELL>set path
path=C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\DELL\anaconda3;C:\Users\DELL\anaconda3\Library\mingw-w64\bin;C:\Users\DELL\anaconda3\Library\usr\bin;C:\Users\DELL\anaconda3\Library\bin;C:\Users\DELL\anaconda3\Scripts;C:\Users\DELL\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\DELL\AppData\Local\Programs\Python\Python39\;C:\Users\DELL\AppData\Local\Microsoft\WindowsApps;C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\DELL\Downloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin;C:\Users\DELL\AppData\Roaming\npm;C:\php;C:\dart-sdk\bin;C:\flutter\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
答案 0 :(得分:-1)
伙计们,我找到了答案: 我去了 env => 系统变量 => 路径(如果你没有创建一个)=> 我添加了以下路径:
C:\flutter\bin;
C:\Windows\System32;
C:\Program Files\Git\bin\git.exe;
C:\Program Files\Git\cmd;
C:\Windows\System32\WindowsPowerShell\v1.0
现在可以了
C:\Users\DELL>flutter doctor
Running "flutter pub get" in flutter_tools... 14.1s
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.18362.1256], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] VS Code (version 1.56.2)
[√] Connected device (1 available)
• No issues found!
哦,显然这不是一个非常正确的答案,所以要求的输出是:
C:\Users\DELL>%SystemRoot%\System32\reg.exe Query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Path REG_SZ C:\flutter\bin;C:\Windows\System32;C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32\WindowsPowerShell\v1.0;
和
C:\Users\DELL>%SystemRoot%\System32\reg.exe Query HKCU\Environment /V Path
HKEY_CURRENT_USER\Environment
Path REG_EXPAND_SZ C:\Users\DELL\anaconda3;C:\Users\DELL\anaconda3\Library\mingw-w64\bin;C:\Users\DELL\anaconda3\Library\usr\bin;C:\Users\DELL\anaconda3\Library\bin;C:\Users\DELL\anaconda3\Scripts;C:\Users\DELL\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\DELL\AppData\Local\Programs\Python\Python39\;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\DELL\Downloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin;C:\Users\DELL\AppData\Roaming\npm;C:\php;C:\dart-sdk\bin;C:\flutter\bin;
为了
C:\Users\DELL\Downloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin
我想我会删除它,因为它是旧的,我不使用它。
所以在建议的修改之后,输出看起来像这样:
C:\Users\DELL>%SystemRoot%\System32\reg.exe Query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /V Path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Path REG_EXPAND_SZ %SYSTEMDRIVE%\flutter\bin;C:\Windows\System32;%PROGRAMFILES%\Git\bin;%PROGRAMFILES%\Git\cmd;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\OpenSSH;%SYSTEMDRIVE%\php;%SYSTEMDRIVE%\dart-sdk\bin;
和:
C:\Users\DELL>%SystemRoot%\System32\reg.exe Query HKCU\Environment /V Path
HKEY_CURRENT_USER\Environment
Path REG_EXPAND_SZ %USERPROFILE%\anaconda3;%USERPROFILE%\anaconda3\Library\mingw-w64\bin;%USERPROFILE%\anaconda3\Library\usr\bin;%USERPROFILE%\anaconda3\Library\bin;%USERPROFILE%\anaconda3\Scripts;%USERPROFILE%\AppData\Local\Programs\Python\Python39\Scripts;%USERPROFILE%\AppData\Local\Programs\Python\Python39;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%USERPROFILE%\AppData\Roaming\npm;C:\php;C:\dart-sdk\bin;C:\flutter\bin;%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin;