Skip to content

local hooks stopped working after updating to latest verison. #18739

Closed

Description

@eyalpazu

The problem

local hooks stopped working after updating to the latest version (Version 3.4.0 (x64)).
The command line works without problems, but it fails to find Python when using the GitHubDesktop GUI.
Error message: "/usr/bin/env: ‘python’: No such file or directory"

Release version

Version 3.4.0 (x64)

Operating system

Windows 10

Steps to reproduce the behavior

Create local hook that uses python.
path: .git/hooks/prepare-commit-msg
And try commit using GitHubDesktop.

Log files

No response

Screenshots

GitHubDesktopProblem

Additional context

No response

Activity

  1. andylwelch commented on Jun 3, 2024

    @andylwelch

    My pre-commit hooks also failed after updating to 3.4.0 in Windows. I get command not found for the tools that used to work, e.g. npm, yarn. I have been attempting fixes related to path C:\Program Files\Git\bin and the import order without any luck. Following this thread now for any more ideas.

  2. ivoyip1101 commented on Jun 3, 2024

    @ivoyip1101

    My pre-commit hooks also failed after updating to 3.4.0 in Windows. I get command not found for the tools that used to work, e.g. npm, yarn. I have been attempting fixes related to path C:\Program Files\Git\bin and the import order without any luck. Following this thread now for any more ideas.

    I have same problem after updating to 3.4.0 in Windows!

  3. jroach-cordel commented on Jun 3, 2024

    @jroach-cordel

    I'm running into this issue when trying to run pwsh.exe as well.

  4. CassBaylock commented on Jun 3, 2024

    @CassBaylock

    Same issue here. I have to use the exact file path in my hooks for it to work now.

  5. ciso-davidpham commented on Jun 3, 2024

    @ciso-davidpham

    Same issue, wsl2 pre-commit hooks working just fine until this latest update, I've checked the environment variables and everything is setup correctly, pointing to where the git binary is in AppData, getting
    '/usr/bin/env: ‘bash’: No such file or directory'

  6. splitice commented on Jun 4, 2024

    @splitice

    Best part is github in all their wisdom doesnt publish older builds. So if you get auto-updated to a broken version you better find a new client.

  7. andylwelch commented on Jun 4, 2024

    @andylwelch

    I found this download url worked for v3.3.18. Also, rename the Update.exe and it will break the auto-update process...

  8. glundgren93 commented on Jun 4, 2024

    @glundgren93

    I think this could've been the root cause.
    #18676

  9. tidy-dev commented on Jun 4, 2024

    @tidy-dev
    Contributor

    👋 The embedded version of Git was recently updated for security reasons. Does anyone have the latest version (2.45.2) Git installed and can successfully run the hooks from the command line?

  10. TheMikeyRoss commented on Jun 4, 2024

    @TheMikeyRoss

    I have the latest git 2.45.2 on windows and I have the latest github desktop version 3.4.0 and I'm still having the same issues where any command I use in a git hook will result in a command not found error

  11. fbastien commented on Jun 4, 2024

    @fbastien

    @TheMikeyRoss With your setup, does this error only occur within GitHub Desktop, or does it also occur when executing git commit command lines?

  12. TheMikeyRoss commented on Jun 4, 2024

    @TheMikeyRoss

    @fbastien It only occurs within the github desktop app. When I make a commit via the terminal the husky hooks run successfully and I face no issues.

    I even installed Atlassian Sourcetree to test it out and I faced no issues. So I'm 100% confident the issue is strictly happeniing when I try to make a commit with the Github Desktop app.

  13. fbastien commented on Jun 4, 2024

    @fbastien

    Thanks for the clarification

  14. master-lou commented on Jun 4, 2024

    @master-lou

    Hello,
    maybe this will help someone, I ran into the issue of command not found after I updated to 3.4.0, I spent most of yesterday trying to get it to work with no success, at the end, I deleted the local repository, and cloned it from remote, everything is back to normal, I could commit, merge, and everything expected from GithubDesktop is working
    so delete your repository ( you can commit your work from CLI ) and clone a new one

  15. asfo commented on Jun 4, 2024

    @asfo

    Hello, maybe this will help someone, I ran into the issue of command not found after I updated to 3.4.0, I spent most of yesterday trying to get it to work with no success, at the end, I deleted the local repository, and cloned it from remote, everything is back to normal, I could commit, merge, and everything expected from GithubDesktop is working so delete your repository ( you can commit your work from CLI ) and clone a new one

    In the case you use Husky, you just "uninstalled it" so, it's not a real fix, you need to run again npm run prepare (or something like that) and then the error will show up again...

  16. 21 remaining items

  17. east-shine commented on Jun 20, 2024

    @east-shine

    @tidy-dev I'm still having issues with version 3.4.1(arm64)

  18. tidy-dev commented on Jun 20, 2024

    @tidy-dev
    Contributor

    @east-shine I am sorry to hear that. It is likely a different root cause. Could you open a new issue to track it? (Please remember to include logs)

  19. exde37b2 commented on Jun 28, 2024

    @exde37b2

    maybe this helps others.
    Having in use 3.4.1, I had run
    nvm install fancy.new.version
    nvm use fancy.new.version

    and ended up with the same problem described above. After running
    nvm use good.old.version

    GitHubDesktop is working again

  20. rmckr commented on Jun 30, 2024

    @rmckr

    maybe this helps others.
    Having in use 3.4.1, I had run
    nvm install fancy.new.version
    nvm use fancy.new.version

    and ended up with the same problem described above. After running
    nvm use good.old.version

    GitHubDesktop is working again

    Have you checked the official Husky instructions for use with NVM?
    https://typicode.github.io/husky/how-to.html#node-version-managers-and-guis

  21. thecloudsingh commented on Jul 16, 2024

    @thecloudsingh

    This issue is with GitHub desktop. When I commit from CLI, it works. I just downgraded GitHub Desktop and it works but does not work with 3.4.2

  22. jflemingframe commented on Jul 17, 2024

    @jflemingframe

    still happening to me

  23. hqxc-bacon commented on Aug 9, 2024

    @hqxc-bacon

    image

  24. hqxc-bacon commented on Aug 9, 2024

    @hqxc-bacon

    图像

    image
    I still have the problem and the solutions above don't fix it

  25. Drumstix42 commented on Aug 19, 2024

    @Drumstix42

    Also still having the issue here. Works in CLI, works in VSCode, broken in Github Desktop. Used to work in Github Desktop just fine.

    Weirdly this comment helps #12586 (comment) but it's not a great solution, as it makes the change OS specific...

  26. petter-eikeland commented on Aug 25, 2024

    @petter-eikeland

    I am also having this issue on 3.4.3 ARM version (Apple Silicon). Downgrading to v. 3.3.18 fixed the issue for me

  27. octavemuhirwa commented on Oct 3, 2024

    @octavemuhirwa

    I am also having this issue on 3.4.5 (arm64) apple m2.

  28. pidark commented on Oct 16, 2024

    @pidark

    I have the same issue Version 3.4.4 on Ubuntu 24.10.
    I've solved editing /usr/share/applications/github-desktop.desktop

    [Desktop Entry]
    Name=GitHub Desktop
    Comment=Simple collaboration from your desktop
    GenericName=GitHub Desktop
    Exec=bash -c "PATH=MY_PATH github-desktop"
    Icon=github-desktop
    Type=Application
    StartupNotify=true
    Categories=GNOME;GTK;Utility;
    MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth;x-scheme-handler/x-github-desktop-dev-auth;

    Where you can find MY_PATH and replace it with

    echo $PATH

    on terminal.

    Hope this help someone.

  29. ColeDCrawford commented on Dec 16, 2024

    @ColeDCrawford

    Yep, this is still an issue on 3.4.9 (Mac M1)

  30. toyota-167 commented on Jan 23, 2025

    @toyota-167

    .cmd

    i got the same issue like this and i fix it by follow your solution, and the error is gone. thanks a lot for you.

    Image

  31. thelsevier commented on Mar 11, 2025

    @thelsevier

    I used to have this issue in v3.4.16. I upgraded to v3.4.18 (arm64, on a Mac) and commit just worked. Nothing in the release notes about it, but I'm glad it's fixed now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions