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
Pre-commit hook fails because it can't find lint-staged #11603
This works when trying to commit using the command line and when tried using VSCode's Git integration, but fails on GitHub Desktop. lint-stage is installed locally and I prefer to keep it that way.
Version & OS
Version 2.6.3
Windows 10 Home
Reacted by Muhammad Afifudin, Sterling G. Baird, littlefireson, Nicholas Zacca, Paridokht Alavinia, Nikita and Simon Sotak Gregor
The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.
Thanks for the report @davehowson. Can you try launching GitHub Desktop via the command line by running the github command and then test to see if you still encounter this error? This may be an issue with GitHub Desktop not inheriting your environment.
It'd also be helpful if you could share the output of $env:path from either CMD or PowerShell.
Hi, same issue here for me.
Using command line, pre-commit hook works but with GitHub Desktop doesn't.
I installed nvm today and after that pre-commit has stopped working.
Nvm puts a symlink in C:/Program Files/nodejs that points to the wanted version.
Could it be that GitHub Desktop cannot follow symlinks?
EDIT:
I didn't open a new issue because I saw that @davehowson installed nvm too
I uninstalled nvm, reinstalled node, restarted Windows and it didn't worked.
So I reinstalled GitHub Desktop and doesn't work again.
But in any other terminal I can commit with pre-commit
github desktop formats files after committing files. I have npm run format to format the files. But after committing, there are some unstaged changes... Can someone please help here
The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.
Activity
davehowson commentedon Feb 16, 2021
I see this issue has occurred to many people but none of the below solutions work
steveward commentedon Feb 19, 2021
Thanks for the report @davehowson. Can you try launching GitHub Desktop via the command line by running the
githubcommand and then test to see if you still encounter this error? This may be an issue with GitHub Desktop not inheriting your environment.It'd also be helpful if you could share the output of
$env:pathfrom either CMD or PowerShell.davehowson commentedon Feb 21, 2021
I tried by running the github command from my projects directory but I still keep getting the same error.
This is the output of the
$env:pathruggi99 commentedon Aug 3, 2021
Hi, same issue here for me.
Using command line, pre-commit hook works but with GitHub Desktop doesn't.
I installed nvm today and after that pre-commit has stopped working.
Nvm puts a symlink in
C:/Program Files/nodejsthat points to the wanted version.Could it be that GitHub Desktop cannot follow symlinks?
EDIT:
I didn't open a new issue because I saw that @davehowson installed nvm too
ruggi99 commentedon Aug 3, 2021
I uninstalled nvm, reinstalled node, restarted Windows and it didn't worked.
So I reinstalled GitHub Desktop and doesn't work again.
But in any other terminal I can commit with pre-commit
coderdave commentedon Oct 13, 2021
What's the status with this? I started
githubfrom the command line but it didn't work for me either.kaisugi commentedon May 18, 2022
any updates?
benson00077 commentedon Jul 21, 2022
Same issue here, with same package.json config + nvm.
Git command line works well but but with GitHub Desktop doesn't.
rdrinovec commentedon Jul 5, 2023
Same issue here.
R-Mohammed-Hasan commentedon Jun 6, 2024
github desktop formats files after committing files. I have npm run format to format the files. But after committing, there are some unstaged changes... Can someone please help here
niik commentedon Jan 14, 2026
Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.
The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.