Skip to content
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 9 - cannot execute binary file #1426

Open
1 task done
pabloimrik17 opened this issue Apr 20, 2024 · 3 comments
Open
1 task done

Husky 9 - cannot execute binary file #1426

pabloimrik17 opened this issue Apr 20, 2024 · 3 comments

Comments

@pabloimrik17
Copy link

pabloimrik17 commented Apr 20, 2024

Troubleshoot

If you're migrating from husky 4, see:
https://typicode.github.io/husky/migrate-from-v4.html

Context
Please describe your issue and provide some context:
Fresh install with pnpm 8 and husky 9.

Just created the basic pre-commit hook from the docs (npm test) and when the hook runs i get this error

.husky/pre-commit: .husky/pre-commit: cannot execute binary file
husky - pre-commit script failed (code 126)

@MartinX3
Copy link

MartinX3 commented May 18, 2024

It suddenly happens to me since today.
I didn't change the computer.

I only made the following system updates on my arch linux laptop with btrfs and restarted my pc:

[2024-05-18T14:20:42+0200] [ALPM] upgraded linux-zen-headers (6.8.9.zen1-2.1 -> 6.9.1.zen1-1.1)
[2024-05-18T14:20:39+0200] [ALPM] upgraded linux-zen (6.8.9.zen1-2.1 -> 6.9.1.zen1-1.1)
[2024-05-18T14:20:37+0200] [ALPM] upgraded libdatachannel (0.21.0-1.1 -> 0.21.1-1.1)
[2024-05-18T14:20:37+0200] [ALPM] upgraded libjuice (1.4.1-1.1 -> 1.4.2-1.1)
[2024-05-18T14:20:37+0200] [ALPM] upgraded bluez-utils (5.75-1 -> 5.76-1)
[2024-05-18T14:20:37+0200] [ALPM] upgraded bluez-libs (5.75-1 -> 5.76-1)
[2024-05-18T14:20:37+0200] [ALPM] upgraded bluez (5.75-1 -> 5.76-1)

So maybe it has something to do with the 6.9.1 kernel.

It only happens with pnpm install.
With pnpm run prepare or executing husky directly it works.

@HayateTsuki
Copy link

Troubleshoot

If you're migrating from husky 4, see: https://typicode.github.io/husky/migrate-from-v4.html

Context Please describe your issue and provide some context: Fresh install with pnpm 8 and husky 9.

Just created the basic pre-commit hook from the docs (npm test) and when the hook runs i get this error

.husky/pre-commit: .husky/pre-commit: cannot execute binary file husky - pre-commit script failed (code 126)

I have the same problem.
After hit
git commit -m "testing pre-commit code"
got error

.husky/pre-commit: .husky/pre-commit: cannot execute binary file
husky - pre-commit script failed (code 126)

Resolved that after change pre-commit file encoding from UTF-16 (as it is as default after initializing husky) to UTF-8. I have done this in VS Code.

OlqSCki1
Screenshot_1

Regards!

@MartinX3
Copy link

MartinX3 commented Jun 25, 2024

It got fixed in the 6.9.x kernel I think.
It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants