husky icon indicating copy to clipboard operation
husky copied to clipboard

Husky 9 - cannot execute binary file

Open pabloimrik17 opened this issue 1 year ago • 4 comments

Troubleshoot

  • [x] Before creating an issue, please check: https://typicode.github.io/husky/troubleshoot.html

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)

pabloimrik17 avatar Apr 20 '24 16:04 pabloimrik17

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.

MartinX3 avatar May 18 '24 16:05 MartinX3

Troubleshoot

  • [x] Before creating an issue, please check: https://typicode.github.io/husky/troubleshoot.html

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!

HayateTsuki avatar Jun 25 '24 07:06 HayateTsuki

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

MartinX3 avatar Jun 25 '24 08:06 MartinX3