Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows failure if install directory has a "!" in it #26571

Closed
jakcharvat opened this issue Jan 15, 2019 · 6 comments · Fixed by #106861
Closed

Windows failure if install directory has a "!" in it #26571

jakcharvat opened this issue Jan 15, 2019 · 6 comments · Fixed by #106861
Assignees
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@jakcharvat
Copy link

jakcharvat commented Jan 15, 2019

I set up flutter and running any flutter command, including flutter doctor results in

Error: The Flutter directory is not a clone of the GitHub project.
       The flutter tool requires Git in order to operate properly;
       to set up Flutter, run the following command:
       git clone -b beta https://github.com/flutter/flutter.git

Git is installed and running git --version returns git version 2.20.1.windows.1.

I've tried installing Flutter through the ZIP on flutter.io, as well as cloning it through both
git clone -b beta https://github.com/flutter/flutter.git
and
git clone -b stable https://github.com/flutter/flutter.git,

restarted my laptop after each and still get the same error after running flutter doctor.

I've never had this happen to me before, and would greatly appreciate any help. Thank you

@jakcharvat
Copy link
Author

Never mind, it seems it was an issue with having an exclamation mark in the path to the sdk (C:\Users\jakch\dev\flutter\!sdk\flutter\bin) and removing it fixed the issue. It might be helpful to provide a clearer error message in this case though, as the problem was completely unrelated to the github repo.

@zoechi zoechi added c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. labels Jan 15, 2019
@zoechi zoechi added this to the Goals milestone Jan 15, 2019
@kangwang1988 kangwang1988 self-assigned this Feb 13, 2019
@kangwang1988
Copy link
Contributor

It seems a bug in flutter.bat
I will have a look.

@kangwang1988 kangwang1988 removed their assignment Jul 15, 2019
@Hixie Hixie closed this as completed Aug 20, 2019
@Hixie Hixie reopened this Aug 20, 2019
@Hixie Hixie changed the title The Flutter directory is not a clone of the GitHub project. Windows failure if install directory has a "!" in it Aug 20, 2019
@Hixie Hixie added the platform-windows Building on or for Windows specifically label Aug 20, 2019
@jmagman jmagman added this to Awaiting triage in Tools - Windows review Jan 10, 2020
@christopherfujino christopherfujino moved this from Awaiting triage to Engineer reviewed in Tools - Windows review Jan 17, 2020
@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@TheRedBull
Copy link

I ran into this issue today - I hold my dev tools in a directory called "!DevTools". After finding this issue, I moved the flutter folder from that directory to another (and changed the PATH var) which worked as expected.

It appears that the "SETLOCAL ENABLEDELAYEDEXPANSION" line in the /bin/.bat files is the main offender here (per various StackOverflow and google searches) - I changed that line to "SETLOCAL EnableExtensions DisableDelayedExpansion" (per the same research) and the flutter commands worked as expected when I moved everything back to the original folder

However, there is a like issue in the /bin/internal/update_dart_sdk.ps1 - which is choking on the ! in the directory name. I'm not well versed in PS scripting so I will continue my research but I wanted to bump this topic

@warp929
Copy link

warp929 commented Jan 20, 2022

I just ran into this issue in Windows 10. The parent folder to flutter had an ! in the name. This cause "flutter doctor" to fail. Command prompt would close without warning. Powershell would give me some sort of Git error when running "flutter doctor". Cloned again. Moving "flutter" to a folder without an exclamation mark and changing the environment variable fixed the problem. Now "flutter doctor" runs.

@moko256
Copy link
Member

moko256 commented Sep 5, 2022

This is fixed by #106861. I'll close this issue.

@moko256 moko256 closed this as completed Sep 5, 2022
@moko256 moko256 added the r: fixed Issue is closed as already fixed in a newer version label Sep 5, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list platform-windows Building on or for Windows specifically r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.
Projects
Tools - Windows review
  
Engineer reviewed
8 participants