skip to Main Content

I recently installed flutter on my Windows 10 system. I was told not to install it into a directory that requires administrator privileges (such as C:Program Files) so I installed it directly into C (Just C:flutter). I have added the necessary environment variable. However if I try to use any flutter commands, whether its from flutter_console or Windows console, both consoles crash. The problem does not occur if I use administrative mode when running both consoles.

I have tried moving the flutter folder into an "src" folder (C:srcflutter) according to the tutorial I was following but it didnt make a difference. Visual Studio code is giving me the "Cannot find Git in your PATH variable" error which im assuming is related to this, because i have been using Git in VS code for a long time.

2

Answers


  1. Chosen as BEST ANSWER

    The problem was with my installation of Flutter. For some reason, installing it directly into C was causing the terminal to require administrative privilege and VS Code not detecting Git.Upon removing flutter from my system and reinstalling it in my Downloads Folder instead, everything worked perfectly after setting up environment variables. My guess is when installing flutter, make sure its in another folder and not directly in your C: drive because that also counts as requiring administrative privilege despite not being in a restricted folder such as Program Files.


  2. Here are 3 things you can do:

    1. Make sure path to your flutter sdk is added in your environment variables.
    2. Make the git paths including path to git directory/git/cmd and path to git directory/git/bin is also added in your environment variables.
    3. Run VS Code as administrator.

    The first point makes sure you can use flutter from console.
    While the second and third point is used to deal with "Cannot find Git in your PATH variable" error.
    Also make sure Flutter SDK path is correct in VS code.
    Hope it helps !

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search