-
Notifications
You must be signed in to change notification settings - Fork 220
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
npm: Not working with bun without node #688
Comments
Hey! Thank you for creating an issue. Do you have an idea of how an executable script could be run with either nodejs or bun? I can think of a statically built executable (probably with bun) but I have concerns. It would be great to know if there's a common solution for such cases. I will investigate |
bun is intended as a node replacement, so just calling a script.js file should work fine.
i will check out some stuff and give a comment |
For those of you, that want to utilize this package with bun now, Ive figured out a quick patch solution until bun support has been officially added. Add these to your package.json file and you'll be good to go.
|
@Blaquewithaq, thanks for the temporary fix! Any news on if @dalisoft's PR removes the node dependency to allow runtime independence? Using the above solution is a whole lot of verbose that would be amazing to clear up. Like @cethien said, Bun is a node runtime replacement, we could simply run any script.js using either Node or Bun depending on the first that passes, since the result will be runtime independent once converted to git hooks. |
since I opened the issue, I was experimenting around a bit and noticed something: when installing other tools like esbuild, there is no js script that executes the binary, only a script to install for the right OS. |
I hope so, I have @dalisoft's PR on my radar, I just need to test it to make sure it solves the issue with bun. |
Hey! Unfortunately there was a backward compatibility issue with the PR, I am going to try a slightly different approach and will notify ASAP. |
@cethien could you please check if the newest lefthook version works? I've changed the order of checks in the hook template and it must not fail with |
hey, only managed to test now I removed node from my system, and tested this one: .lefthook.yml # yaml-language-server: $schema=https://json.schemastore.org/lefthook.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
commit-msg:
parallel: true
commands:
commitlint:
run: bun commitlint --edit $1 it seemed to work, my commit was some gibberish and i got a commitlint error. |
seems to be resolved |
Hello again. So I've done
What should I do to run the Next app with all deps in Bun:alpine container correctly? |
Right now there is no way to do this other than installing lefthook from a different source (e.g. alpine registry). This is because postinstall hook of the npm package requires node |
🔧 Summary
seems like the tool doesn't work without node. i have only bun for js on my system.
after
lefthook install
, every hooked git actions results in/usr/bin/env: ‘node’: No such file or directory
Lefthook version
1.6.7 599459e
Steps to reproduce
Expected results
commitlint error
Actual results
/usr/bin/env: ‘node’: No such file or directory
Logs / Screenshots
The text was updated successfully, but these errors were encountered: