Repository navigation
Open
Labels
bugSomething isn't workingSomething isn't workingbun installSomething that relates to the npm-compatible clientSomething that relates to the npm-compatible clientperformanceAn issue with performanceAn issue with performance
Description
What version of Bun is running?
1.2.14+6a363a38d
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
mkdir test && cd test
bun add -D --no-cache husky
bun rm husky
bun add -D husky
bun rm husky
bun add -D huskyWhat is the expected behavior?
bun i ... will be faster than bun i ... --no-cache
What do you see instead?
Here's the speed with no cache:
chao@MacBook-Air test % bun i @commitlint/cli @commitlint/config-conventional -D --no-cache
bun add v1.2.14 (6a363a38)
installed @commitlint/[email protected] with binaries:
- commitlint
installed @commitlint/[email protected]
101 packages installed [7.82s]remove:
chao@MacBook-Air test % bun rm @commitlint/cli @commitlint/config-conventional
bun remove v1.2.14 (6a363a38)
- @commitlint/cli
- @commitlint/config-conventional
2 packages removed [2.00ms]
package.json has no dependencies! Deleted empty lockfilesince bun i --no-cache will not create cache, I run the following command to add cache:
chao@MacBook-Air test % bun i @commitlint/cli @commitlint/config-conventional -D
bun add v1.2.14 (6a363a38)
installed @commitlint/[email protected] with binaries:
- commitlint
installed @commitlint/[email protected]
2 packages installed [242.50s]remove again:
chao@MacBook-Air test % bun rm @commitlint/cli @commitlint/config-conventional
bun remove v1.2.14 (6a363a38)
- @commitlint/cli
- @commitlint/config-conventional
2 packages removed [2.00ms]
package.json has no dependencies! Deleted empty lockfileinstall with cache:
chao@MacBook-Air test % bun i @commitlint/cli @commitlint/config-conventional -D
bun add v1.2.14 (6a363a38)
installed @commitlint/[email protected] with binaries:
- commitlint
installed @commitlint/[email protected]
2 packages installed [491.09s]You can see that bun i with cache took much time than that with no cache.
Here's the table:
| run | command | wall-clock | cache state |
|---|---|---|---|
| 1 | bun i … --no-cache | 7.82 s | cache bypassed & not written |
| 2 | bun i … | 242.50 s | cache populated for the first time |
| 3 | bun i … | 491.09 s | cache already full |
Additional information
My configurations:
export BUN_INSTALL_BIN="/Users/chao/.local/bin"
export BUN_INSTALL_GLOBAL_DIR="$XDG_DATA_HOME/bun"
export BUN_INSTALL_CACHE_DIR="$XDG_CACHE_HOME/bun"Reacted by hoywu
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingbun installSomething that relates to the npm-compatible clientSomething that relates to the npm-compatible clientperformanceAn issue with performanceAn issue with performance
Activity
RiskyMH commentedon May 28, 2025
Interesting, sadly it does seem to work better for me though (maybe it has better resources being M3 max)
ermengchao commentedon May 28, 2025
Thanks for your reproduction and response! I use stats as the system monitor on my mac, and when I ran the
bun icommands, I didn't notice any significant CPU or memory load. So unfortunately I don’t think it has anything to do with system resources.However, when I tried reproducing the issue twice today, it didn’t occur the first time, but it did reappear the second time(I'm sure that I've run the same commands). So maybe it was just an unusual bug, and just wait a moment happened to fix it? 😂 I really have no idea.
For the second time here's the verbose output:
It keeps waiting for the tasks, and that's the case why
bun installtakes so long. I've asked ChatGPT for help, he inferred that maybe the cache was too large, which might take a long time to be scanned. But when I either delete the cache manually or runbun pm cache rm, it doesn't work.Again, thanks for your patience! I'm a college student from China, a newbie to both coding and the GitHub community. Your efforts to maintain such a great open-source project and support the community is really cool!!! I hope I can be the one with open-source spirit and contribute to open source like you in the future! 😎
bmakan commentedon Jun 17, 2025
I can confirm using
--no-cacheresolved my "endless" resolving issue as well.I do use company proxy. Maybe that's the root of it.
jacquesbh commentedon Aug 10, 2025
I confirm the same behavior, running on macos M3 Max.
Jinx-1120 commentedon Nov 9, 2025
When I set the registry to https://registry.npmjs.org/, everything seems to be working fine now.
rekram1-node commentedon Jan 1, 2026
Yeah when behind a proxy, --no-cache is basically a requirement for me, otherwise it seems to hang forever
jacquesbh commentedon Jan 2, 2026
After updating Opencode, I run this command:
The
bunfig.toml:Basically to disable caching on bun.
That's the only solution I found.
Remove Bun install workaround for caching
fix: v2.2.1 — security, data integrity, memory/perf hardening across …