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

npx lefthook throwing command not found #773

Closed
luizwhite opened this issue Jul 17, 2024 · 3 comments · Fixed by #774
Closed

npx lefthook throwing command not found #773

luizwhite opened this issue Jul 17, 2024 · 3 comments · Fixed by #774
Labels
bug Something isn't working

Comments

@luizwhite
Copy link

🔧 Summary

It seems after lefthook 1.6.18, when git hooks are run an error occurs with the message sh: lefthook: command not found.

Lefthook version

❯ npx lefthook version -f
sh: lefthook: command not found

Steps to reproduce

❯ npx lefthook version -f
sh: lefthook: command not found

Expected results

❯ npx lefthook@1.6.18 version -f
1.6.18 4ea200b04d374ba1bb9f66a940430309a2838d27

Actual results

❯ npx lefthook version -f
sh: lefthook: command not found

Possible Solution

No solution, since when lefthook creates git hooks, it falls in this elif:

  elif command -v npx >/dev/null 2>&1
  then
    npx lefthook "$@"

So, it is not possible in this case to set lefthook version, correct?

Logs / Screenshots

❯ LEFTHOOK_VERBOSE=true npx lefthook version -f
sh: lefthook: command not found

node/npm

❯ node --version
v20.15.1
❯ npm --version
10.8.2
@luizwhite luizwhite added the bug Something isn't working label Jul 17, 2024
@luizwhite
Copy link
Author

luizwhite commented Jul 18, 2024

Hi @mrexox !
The error persists

Screen.Recording.2024-07-18.at.07.45.32.mov

I think the fix will solve pre-installed git hooks, but new ones will throw the error above

@mrexox
Copy link
Member

mrexox commented Jul 19, 2024

Yes, npx lefthook is still not working for some reason. I am investigating.

@mrexox
Copy link
Member

mrexox commented Jul 19, 2024

I've fixed the issue with 1.7.4 release!

@mrexox mrexox closed this as completed Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants