-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Husky - pre-commit hook exited with code 127 (error) #1478
Comments
Not really an issue with husky. It's due to If you run the content of You can also start VSCode from the terminal so that it inherits the |
Husky 9.1.2 cannot handle PATH with spaces. Line 16 in 35fba84
|
I tried running C:\Users\gwbreton\OneDrive - Capgemini\Documents\GoldenEye_back_java\.husky> /bin/sh "C:/Users/gwbreton/OneDrive - Capgemini/Documents/GoldenEye_back_java/.husky/pre-push"
/bin/sh : Le terme «/bin/sh» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez
l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez.
Au caractère Ligne:1 : 1
+ /bin/sh "C:/Users/gwbreton/OneDrive - Capgemini/Documents/GoldenEye_b ...
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (/bin/sh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException It's written in French but it says that "/bin/sh" is not recognized as a command, function, script file or executable. Also. Here is the result of my path variable PS C:\Users\gwbreton\OneDrive - Capgemini\Documents\GoldenEye_back_java\.husky> echo $Env:PATH
C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerS
hell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Users\gwbreton\OneDrive - Capg
emini\Documents\apache-maven-3.9.8-bin\apache-maven-3.9.8;C:\Program Files\Git\usr\bin\cygpath.exe;C:\Users\gwbreton\scoop\shims;C:\Users\gwbreton\A
ppData\Local\Microsoft\WindowsApps;C:\Users\gwbreton\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\gwbreton\.dotnet\tools;C:\Users\gwbreton\
AppData\Local\GitHubDesktop\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2024.1.4\bin;;C:\Program Files\Git\usr\bin\cygpath.exe;;C:\Users\gwbreton\OneDrive - Capgemini\Documents\GoldenEye_back_java\node_modules\.bin |
Also hitting the exact same issue with 9.1.2 when using WSL. OS: Windows 11 using Ubuntu 22.04.4 via WSL |
v9.1.3+ should better handle space in path if that's the issue |
Brilliant, thanks @typicode! |
thanks to @uniabis for pointing it out |
Describe the bug
WHen I try to commit either from the terminal, intellij IDE, Intellij IDE terminal or even Github Desktop, I get an error and the commit fail.
Version & OS
I am using Windows 11 and my husky version is 8.0.3
Steps to reproduce the behavior
Run git commit from the terminal or Intellij IDEA
Expected behavior
The commit is pushed.
Actual behavior
The commit isn't pushed and it gives an error.
Screenshots
Logs
The text was updated successfully, but these errors were encountered: