Open anchan828 opened 6 months ago
i want to note that running npm, yarn, pnpm, and bun; all with their respective version of --ignore-scripts does not cause issues. therefore, i am skeptical of the need of the postinstall script in bun.
platform checks are already supported by package managers, and instead of using a wrapper JS script to start the bin, the bin could just be the bun binary. (i tested this using a local tarball on all relevant package managers)
surely the status quo is not the best approach to this problem.
The postinstall script is necessary to move the symlink from the optional dependency to the bin/bun executable
We’d like for Yarn Berry to work but haven’t figured out a way without making node call bun, which would negate the start time benefits of Bun.
Also if using the Yarn PnP feature it definitely won’t work ( that doesn’t support non-JS executables unless they’ve fixed that since I last checked)
There’s unfortunately not much we can do about this, it’s mostly up to Yarn Berry to address these issues
If you have any ideas though please share
okay so my earlier comment missed some things so the postinstall is likely neccecary (there are alot of edge cases).
we agree that yarn v1 has to work.
when this is fixed i also want to document all of the reasons for this script and make it very clear what is going on, because without such knowledge it is very very easy to discard this script.
This question was initially posted on Discord: https://discord.com/channels/876711213126520882/1217331919507951688
What version of Bun is running?
1.0.30+1424a196f
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
build.log
What is the expected behavior?
yarn add bun
installs bun innode_modules/.bin
without error.What do you see instead?
No response
Additional information
Hi :wave: , I am trying to introduce
bun:test
only to a project using yarn@4.1.1. But the installation fails due to this code: https://github.com/oven-sh/bun/blob/e45ece05d9b8ee014901a4e89145d51b6eb843db/packages/bun-release/src/npm/install.ts#L129-L134I removed the code that throws the error and installed it, and
yarn bin
recognizes the bun.I installed
yarn add bun@1.0.28
in project, and globally withcurl -fsSL https://bun.sh/install | bash
.Is this error being addressed due to a problem with yarn@1.x or
yarn dlx
?