You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bun install/create fails with error: ConnectionRefused downloading package manifest #4988
Reacted by Neil Francis Nahid, Spencer von der Ohe, Antti, rinvii, Christian Petersen, Lucas Liu, Silvio Brändle, Sandro Tanner, humemm, Bricked and 15 more
For me it immediately trows this error. I have a working Internet connection.
I also upgraded to v1.0.1 and still the same issue
$ bun upgrade
bun v1.0.1 is out! You're on 1.0.0[20.71s] Upgraded.Welcome to bun v1.0.1!Report any bugs: https://github.com/oven-sh/bun/issuesWhat's new:
https://github.com/oven-sh/bun/releases/tag/bun-v1.0.1
Changelog:
https://github.com/oven-sh/bun/compare/bun-v1.0.0...bun-v1.0.1
$ time bun install
bun install v1.0.1 (31aec4eb)
🔍 bun-types [11/12]
error: ConnectionRefused downloading package manifest bun-types
🔍 figlet [12/12]
error: ConnectionRefused downloading package manifest figlet
error: bun-types@latest failed to resolve
error: figlet@^1.6.0 failed to resolve
bun install 0.02s user 0.02s system 38% cpu 0.100 total
Can confirm this is still an issue for bun 1.0.4, I was able to work around on macos by setting IVP6 to "Link-local Only" in system settings. Including screenshot here in case it saves someone else a bit of time
Original error
What version of Bun is running?
$ bun --revision
1.0.4+745b6b94ee56cad24d475799690cc9a89957d15b
What platform is your computer?
Darwin mbp-16.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64 i386
What steps can reproduce the bug?
$ bun create elysia hi-elysia
What do you see instead?
error: ConnectionRefused
----- bun meta -----
Bun v1.0.4 (745b6b94) macOS x64 22.6.0
CreateCommand:
Elapsed: 75020ms | User: 20ms | Sys: 6ms
RSS: 6.80MB | Peak: 6.80MB | Commit: 34.61MB | Faults: 0
----- bun meta -----
0 0x103a9d8d0 WTFGetBacktrace
Crash report saved to:
~/.bun/.bun-crash/v1.0.4-1696777966674.crash
Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord
Reacted by Julian Toscani, CJ, Antti, Omkar Kirpan and Chindriș Mihai - Alexandru
So yes, disabling or preferring IPv4 is the correct solution. Here's the process for WSL:
Open this /etc/gai.conf config file using this command: sudo vi /etc/gai.conf
Either add or uncomment this line precedence ::ffff:0:0/96 100, uncommenting is removing the # sign.
Tap Esc key and then type :w to save file. Close and reopen terminal, bun install should install now.
N.B.: This will PREFER IPv4 not necessarily turn IPv6 off.
Reacted by Gabriel Joshua Paet, Aite Aigbe, Christofer Luiz dos Santos Mendes, Diego Beltran, liupengfei, Cristhofer Andana Alcaino and Chindriș Mihai - Alexandru
Reacted by Gabriel Joshua Paet, Christofer Luiz dos Santos Mendes, djdeo and Chindriș Mihai - Alexandru
Reacted by Gabriel Joshua Paet and Chindriș Mihai - Alexandru
might be related. I get this while trying to bun install or bun add anything on an old intel mac (it's so old the latest OS available for it is Big Sur)
The error is slightly different to above failed to initialize compression stream downloading package manifest
I tried disabling IPv6 as best I could but wasn't able to move forward
Same here on a Macbook pro Mid 2014 (Intel) and MacOS Big Sur 11.7.10.
This is specific to Bun v1.0.21, it works well on v1.0.20:
bun add v1.0.21 (837cbd60)
🔍 cowsay [6/6]
error: failed to initialize compression stream downloading package manifest cowsay
error: cowsay@ failed to resolve
cd ..
rm -rf .bun
curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.20"######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun
Run 'bun --help' to get started
cd quickstart
bun install cowsay
bun add v1.0.20 (09d51486)
+ @types/[email protected]
installed [email protected] with binaries:
- cowsay
- cowthink
36 packages installed [1.52s]
If you are using WSL on Windows, please check the Mirrored mode networking. If this setting is enabled, IPv6 is supported and ConnectionRefused may occur. In fact, I turned this setting off and the error went away.
How about making the verbose mode more verbose? If it printed the URL, from which it tried to download the .tgz file, I'd see right away that it wasn't npmjs.org and I forgot to remove the NPM proxy from registry in ~/.bunfig.toml...
❯ bun i --verbose
bun install v1.2.9 (9a329c04)
Enqueue package manifest for download: puppeteer
Enqueue package manifest for download: puppeteer-core
🔍 Resolving [1/2] [PackageManager] waiting for 2 tasks
[PackageManager] waiting for 2 tasks
[PackageManager] waiting for 2 tasks
[PackageManager] waiting for 2 tasks
[PackageManager] waiting for 2 tasks
[PackageManager] waiting for 2 tasks
[PackageManager] waiting for 1 tasks
[PackageManager] waiting for 1 tasks
[PackageManager] waiting for 1 tasks
warn: FailedToOpenSocket downloading package manifest puppeteer. Retry 1/5...
warn: ConnectionRefused downloading package manifest puppeteer. Retry 2/5...
...
warn: FailedToOpenSocket downloading package manifest puppeteer-core. Retry 4/5...
warn: ConnectionRefused downloading package manifest puppeteer-core. Retry 5/5...
error: ConnectionRefused downloading package manifest puppeteer
error: FailedToOpenSocket downloading package manifest puppeteer-core
Clean lockfile: 417 packages - 417 packages in 997.1us
error: [email protected] failed to resolve
error: [email protected] failed to resolve
Reacted by Orkhan Alikhanov and Chindriș Mihai - Alexandru
It was failing because bun.lock specifies url to the package as https://npm.company.com/typescript/-/typescript-5.9.3.tgz which does not exist outside our internal network. It's very hard to debug what happened without having the full url in the logs
I'm experiencing the same issue where adding dependencies to a project on a work computer made it impossible to install said dependencies from my personal computer.
I would consider it a dirty move to delete the bun.lock file.
Is there any Bun command that allows resetting existing packages from the default NPM registry ?
Creating a ~/.bunfig.toml setting the default NPM registry does not work.
Verified on main at df84f8d: when a hostname resolves to an IPv6 address that refuses and an IPv4 address that works, bun install now falls back to IPv4 instead of failing with ConnectionRefused.
# registry bound to 127.0.0.1 only; ::1 refuses; localhost → [::1, 127.0.0.1]
$ bun install # registry = http://localhost:<port>/
error: GET http://localhost:<port>/figlet - 404 # reached server — no ConnectionRefused
If you still see this error today, it is almost certainly a stale custom registry in ~/.npmrc, bunfig.toml, or a bun.lock that hard-codes an internal registry URL — check those first.
Activity
nicu-chiciuc commentedon Sep 13, 2023
I'm having the same issue with
it took more than 7 minutes to get to this error
I'm running it on a M1 mac:
I assume this is caused by ipv6.
PrajvalBadiger commentedon Sep 13, 2023
For me it immediately trows this error. I have a working Internet connection.
I also upgraded to v1.0.1 and still the same issue
$ time bun install bun install v1.0.1 (31aec4eb) 🔍 bun-types [11/12] error: ConnectionRefused downloading package manifest bun-types 🔍 figlet [12/12] error: ConnectionRefused downloading package manifest figlet error: bun-types@latest failed to resolve error: figlet@^1.6.0 failed to resolve bun install 0.02s user 0.02s system 38% cpu 0.100 totalabdielbrilhante commentedon Sep 13, 2023
Having this problem in an M1 mac using 1.0.1 too, but it does work if I set IPv6 to link-local only.
PrajvalBadiger commentedon Sep 13, 2023
I am not sure how to configure IPv6 to link-local only on linux.
For me it works when i disable IPv6 in kernel cmdline parameters
jjhesk commentedon Sep 20, 2023
same problem with 1.0.2
shamiulalamupom commentedon Sep 23, 2023
I got this when I ran
time bun install`bun install v1.0.3 (25e69c7)
🔍 bun-types [6/6]
error: FailedToOpenSocket downloading package manifest bun-types
error: bun-types@latest failed to resolve
real 1m5.533s
user 0m0.013s
sys 0m0.005s`
acro5piano commentedon Sep 24, 2023
Fixed by this:
https://wiki.archlinux.org/title/IPv6#Disable_IPv6
Then run
sudo systemctl restart systemd-sysctl.servicechristiannaths commentedon Oct 8, 2023
Can confirm this is still an issue for
bun 1.0.4, I was able to work around on macos by setting IVP6 to "Link-local Only" in system settings. Including screenshot here in case it saves someone else a bit of timeOriginal error
What version of Bun is running?
What platform is your computer?
What steps can reproduce the bug?
What do you see instead?
Kitanga commentedon Oct 9, 2023
So yes, disabling or preferring IPv4 is the correct solution. Here's the process for WSL:
Open this
/etc/gai.confconfig file using this command:sudo vi /etc/gai.confEither add or uncomment this line
precedence ::ffff:0:0/96 100, uncommenting is removing the#sign.Tap Esc key and then type
:wto save file. Close and reopen terminal,bun installshould install now.N.B.: This will PREFER IPv4 not necessarily turn IPv6 off.
godismyjudge95 commentedon Jan 2, 2024
Can confirm this is an issue on bun 1.0.21.
Disabling IPv6 solved the issue.
(On Debian 11)
YoavCodes commentedon Jan 3, 2024
might be related. I get this while trying to
bun installorbun addanything on an old intel mac (it's so old the latest OS available for it is Big Sur)The error is slightly different to above
failed to initialize compression stream downloading package manifestI tried disabling IPv6 as best I could but wasn't able to move forward
rinvii commentedon Jan 4, 2024
I'm also getting the same error on an old intel mac bun 1.0.21
failed to initialize compression stream downloading package manifestI set ipv6 to link-local only, but that didn't work.
baptistecs commentedon Jan 4, 2024
Hi,
Same here on a Macbook pro Mid 2014 (Intel) and MacOS Big Sur 11.7.10.
This is specific to Bun v1.0.21, it works well on v1.0.20:
23 remaining items
hinerix commentedon Feb 9, 2025
If you are using WSL on Windows, please check the Mirrored mode networking. If this setting is enabled, IPv6 is supported and ConnectionRefused may occur. In fact, I turned this setting off and the error went away.
sayjeyhi commentedon Feb 15, 2025
For me the issue was having a root level
.npmrcwhich was using my job npm registeration proxyumrashrf commentedon Apr 11, 2025
For me having https://verdaccio.org/ turned off was the problem with custom .npmrc
prantlf commentedon Apr 11, 2025
How about making the verbose mode more verbose? If it printed the URL, from which it tried to download the
.tgzfile, I'd see right away that it wasn't npmjs.org and I forgot to remove the NPM proxy fromregistryin~/.bunfig.toml...[-]bun install/create fails with error: ConnectionRefused downloading package manifest [/-][+]bun install/create fails with error: ConnectionRefused downloading package manifest[/+]warrenc5 commentedon Nov 16, 2025
Tell the internet, it might be too late to stop the rollout
warrenc5 commentedon Nov 16, 2025
which command did you use?
npm config rm registryOrkhanAlikhanov commentedon Dec 6, 2025
I just ran into similar issue. In my case
bun.lockhad company registry specified for a few packages. I was getting this errorIt was failing because
bun.lockspecifies url to the package ashttps://npm.company.com/typescript/-/typescript-5.9.3.tgzwhich does not exist outside our internal network. It's very hard to debug what happened without having the full url in the logsI'm attaching minimal reproduction:
bun-install-fails.zip
KaKi87 commentedon Dec 28, 2025
Hi,
I'm experiencing the same issue where adding dependencies to a project on a work computer made it impossible to install said dependencies from my personal computer.
I would consider it a dirty move to delete the
bun.lockfile.Is there any Bun command that allows resetting existing packages from the default NPM registry ?
Creating a
~/.bunfig.tomlsetting the default NPM registry does not work.Thanks
Force IPv4 preference in DNS to fix bun install network failures
robobun commentedon Jul 24, 2026
Fixed by #11206 (Happy Eyeballs).
Verified on main at df84f8d: when a hostname resolves to an IPv6 address that refuses and an IPv4 address that works,
bun installnow falls back to IPv4 instead of failing withConnectionRefused.If you still see this error today, it is almost certainly a stale custom registry in
~/.npmrc,bunfig.toml, or abun.lockthat hard-codes an internal registry URL — check those first.ungario commentedon Aug 2, 2026
still getting this issue on 1.3.14 having ipv6 set to link-local only and no stale lock file