You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opening repository in command prompt results in catastrophic error #3825
Unable to open repository in command prompt from the desktop app. Restarting the app results in the same error every time.
Version
1.0.12
GitHub Desktop version: 1.0.12
OS version: Windows 6.1.7601 (Windows 7 Ultimate SP1 64-bit)
Steps to Reproduce
Expected behavior: Opened in command prompt
Actual behavior: Error on the desktop app
Reproduces how often: 100%
Logs
Error: spawn where ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
My gut feeling is that your PATH value isn't configured as expected.
Could you open a command prompt, run these two commands and attach the output here:
> echo %PATH%
> where cmd
This is what it looks like on one of my developer VMs:
Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\shiftkey>echo %PATH%
C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\; ...
C:\Users\shiftkey>where cmd
C:\Windows\System32\cmd.exe
Manual check confirms, cmd.exe is in c:\Windows\System32
The exact error message received is
Error: spawn where ENOENT
at exports._errnoException (util.js:1050:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Actually, I've seen it no matter what shell I opt for - Git Bash, Powershell, or Command Prompt.
This is puzzling, because Git Bash and PowerShell don't rely on PATH in the same way.
Git Bash should be found in the registry at HKLM\SOFTWARE\GitForWindows and looking for the install directory in the InstallDir key (source)
PowerShell should also be found registry for HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\PowerShell.exe and tries to replace `%SYSTEMROOT% if it's in the path (source)
We had some registry access issues in the past when group policy would restrict access to regedit.exe and reg.exe, but in those cases you wouldn't be able to see it in the list, which sounds different to what you're reporting about it failing to launch.
Please open a fresh issue for either of these if they're repeatable, and provide any extra information or clues you think will help understand why they're failing to launch.
Can you tell me what the output of this command is in your Command Prompt?
> echo %COMSPEC%
If this is set to something other than C:\WINDOWS\system32\cmd.exe that's probably the root cause here. We should be falling back to the right path if that's not set, maybe we shouldn't be trusting these environment variables?
@gilmae nevermind, it's still totally a PATH issue. The launch steps are different to how we're resolving the shells on disk, and in some cases we just use START {command} (which relies on {command} being found on the PATH).
Activity
[-]Desktop App Error[/-][+] Opening repository in command prompt results in catastrophic error[/+]shiftkey commentedon Jan 21, 2018
@laZaru5ap thanks for the report.
The code to launch
cmdis rather straightforward:My gut feeling is that your
PATHvalue isn't configured as expected.Could you open a command prompt, run these two commands and attach the output here:
This is what it looks like on one of my developer VMs:
gilmae commentedon Jan 30, 2018
I'm seeing the same issue as the OP. Actually, I've seen it no matter what shell I opt for - Git Bash, Powershell, or Command Prompt.
Manual check confirms, cmd.exe is in c:\Windows\System32
The exact error message received is
shiftkey commentedon Jan 30, 2018
@gilmae thanks for the details. I think the fix for this is to provide the full path when spawning
cmd.shiftkey commentedon Jan 30, 2018
@gilmae
This is puzzling, because Git Bash and PowerShell don't rely on PATH in the same way.
HKLM\SOFTWARE\GitForWindowsand looking for the install directory in theInstallDirkey (source)HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\PowerShell.exeand tries to replace `%SYSTEMROOT% if it's in the path (source)regedit.exeandreg.exe, but in those cases you wouldn't be able to see it in the list, which sounds different to what you're reporting about it failing to launch.Please open a fresh issue for either of these if they're repeatable, and provide any extra information or clues you think will help understand why they're failing to launch.
shiftkey commentedon Jan 30, 2018
@gilmae so I looked over the code and we're already handling the lack of a
PATHfor the cmd prompt:Can you tell me what the output of this command is in your Command Prompt?
If this is set to something other than
C:\WINDOWS\system32\cmd.exethat's probably the root cause here. We should be falling back to the right path if that's not set, maybe we shouldn't be trusting these environment variables?gilmae commentedon Jan 30, 2018
shiftkey commentedon Jan 30, 2018
@gilmae nevermind, it's still totally a PATH issue. The launch steps are different to how we're resolving the shells on disk, and in some cases we just use
START {command}(which relies on {command} being found on the PATH).desktop/app/src/lib/shells/win32.ts
Lines 130 to 164 in 86edf4c
In fact
powershellalso suffers from the same defect, so I'll see if I can also fix that while I'm in here. I'm not sure about Git Bash though.laZaru5ap commentedon Feb 1, 2018
@shiftkey Yes, I think it is a issue with the PATH. On its own, it works perfectly fine.