Open kisaragi-hiu opened 2 months ago
This is caused by running bun install -g bun
, which writes an empty bun.exe
file into $PATH which somehow leads to running that version of bun instead
To clarify, I did not directly run bun install -g bun
to trigger this. However, my global package.json (~/.bun/install/global/package.json
) does turn out to have an entry for Bun, and removing it stops this behavior.
A search in my shell history showed that I did run bun install -g bun
at some point (my global package.json suggests it's when 1.1.10 was latest), and that that was the last time I ran bun install -g
before today.
So the error here is
bun install -g bun
(arguably a mistake), bun
becomes an empty filebun install -g
will trigger the same behavior, until the user manually removes bun from ~/.bun/install/global/package.json
What version of Bun is running?
1.1.27+267afa293
What platform is your computer?
Linux 6.8.0-40-generic x86_64 x86_64
What steps can reproduce the bug?
Install Bun through the install script, in self-managed mode (not sure if this is necessary)
Install a package globally. Wait for it to succeed.
bun add -g svelte-language-server
The
bun
command now does nothing.whereis bun
shows it's still in ~/.bun/bin/bun, but opening that file / symlink shows an empty file. Evidently the result of the postinstall trick described in~/.bun/install/global/node_modules/bun/bin/README.txt
:... has been destroyed.
What is the expected behavior?
Bun stays around, installing a global package does not destroy the installation.
What do you see instead?
Bun self-destructs after installing a global package.
Additional information
No response