Open gwendal-sogeti opened 1 month ago
Not really an issue with husky. It's due to make
not being found in PATH
.
If you run the content of pre-push
manually in your terminal and it works, try displaying PATH
and compare it with the one from husky - command not found in PATH=
. It may help you find which directory is missing.
You can also start VSCode from the terminal so that it inherits the PATH
with the directory containing make
.
Husky 9.1.2 cannot handle PATH with spaces. https://github.com/typicode/husky/blob/35fba846c4a9b83f64a95d8a0bde5aa648fdc449/husky#L16
export PATH="node_modules/.bin:$PATH"
I tried running pre-push
in Intellij IDEA and it gave me an error related to /bin/sh
:
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 Node: 20.16.0 Husky: 9.1.2
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