You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Flutter Doctor在命令提示符与PowerShell中均无法运行求助

Fixing "where is not recognized" and Git Not Found Errors When Running flutter doctor on Windows

Hey there, let's work through these two issues you're facing with Flutter setup on Windows—they're both tied to system environment variables, so we can sort them out step by step.

First: Fix the "'where' is not recognized" Error

The where command is a built-in Windows tool that Flutter relies on to locate dependencies like Git. This error shows up because your system can't find the where.exe file, which lives in the C:\Windows\System32 folder. Here's how to fix it:

  • Right-click on "This PC" → select Properties → click Advanced system settings → go to the Environment Variables tab.
  • In the System variables section (not user variables), find the Path variable and click Edit.
  • Check if C:\Windows\System32 is already listed. If not, click New and paste that exact path.
  • Save all changes, then close and reopen your Command Prompt—this is critical, because environment variable changes don't take effect in already open terminals.

Second: Fix the "Git not found in path" Error

Even though you added Git to your Path, there might be a few reasons Flutter can't locate it:

  • Double-check the Git path: Git is usually installed in either C:\Program Files\Git\cmd (where git.exe lives) or C:\Program Files\Git\bin (for helper tools). Add both paths to your System Path variable (follow the same steps as above for editing Path).
  • Verify Git works on its own: After updating Path and reopening Command Prompt, run git --version. If this returns Git's version number, your Path is set correctly. If not, double-check your Git installation path—maybe you installed it in a custom location.
  • Ensure you edited System Variables: Sometimes people only update user-level Path variables, but Flutter Doctor checks system-level variables. Always edit the Path under System variables for global tools like Git and Flutter.

Once you've sorted both of these, run flutter doctor again—it should now be able to locate Git and use the where command properly.

内容的提问来源于stack exchange,提问作者maaoui karim

火山引擎 最新活动