Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Bun does not wrap Node. Bun is a JavaScript runtime and suite of tools separate from Node. We do implement Node APIs and spend an enormous amount of time on compatibility. We have to use the same `code` property on many errors or libraries that rely on it break.

It’s also possible you ran a package.json script that had the #!/usr/bin/env node shebang at the top, which Bun by default respects. You can force it to use bun by prefixing the command with “--bun”, like “bun --bun my-executable”

What error did you run into?



This was probably it. Thanks.

I think it's a gotcha to run a script with another runtime than the one I launched from the terminal, though.

If I launch a script directly with a runtime, I expect it to disregard any shebangs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: