evilmartians / lefthook

Fast and powerful Git hooks manager for any type of projects.
MIT License
4.99k stars 218 forks source link

git commit command with error in macos `14.4.1` for M3. #775

Closed KomachiSion closed 4 months ago

KomachiSion commented 4 months ago

:wrench: Summary

git commit command with error in macos 14.4.1 for M3.

╭──────────────────────────────────────╮
│ 🥊 lefthook v1.7.3  hook: pre-commit │
╰──────────────────────────────────────╯
npx: installed 1 in 1.106s
npx: command not found: lefthook-darwin-x64

Lefthook version

 npx lefthook version 
1.7.3

Steps to reproduce

run git commit command with lefthook 1.7.3

Expected results

commit successfully

Actual results

error: npx: command not found: lefthook-darwin-x64

Possible Solution

force downgrade to 1.7.2.

npm install lefthook@1.7.2 --save-dev

Logs / Screenshots

19:58:44.675: [nacos] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false checkout HEAD -- pom.xml
19:58:57.931: [nacos] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- pom.xml
19:58:57.985: [nacos] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F /private/var/folders/yj/8c9m_w0s4hv6zvryj59r75lr0000gp/T/git-commit-msg-.txt --
╭──────────────────────────────────────╮
│ 🥊 lefthook v1.7.3  hook: pre-commit │
╰──────────────────────────────────────╯
npx: installed 1 in 1.106s
npx: command not found: lefthook-darwin-x64
luizwhite commented 4 months ago

similar issues here https://github.com/evilmartians/lefthook/issues/773 I replied that the error still occurs

amochkin commented 4 months ago

Try 1.6.19 or 1.6.18, hope it helps.

KomachiSion commented 4 months ago

I think this bug is from PR https://github.com/evilmartians/lefthook/pull/774.

but https://github.com/evilmartians/lefthook/pull/774 close #733, maybe different.

KomachiSion commented 4 months ago

Try 1.6.19 or 1.6.18, hope it helps.

I force downgrade to 1.7.2, it work well. Before 1.7.3 released and auto-upgrade, git commit never failed.

mrexox commented 4 months ago

Hey! Please checkout 1.7.4 release. This issue must be fixed there.