bun icon indicating copy to clipboard operation
bun copied to clipboard

bun v1.1.12 [WINDOWS?] stuck resolving when adding/installing package NOT in cache

Open cpakken opened this issue 1 year ago • 25 comments

What version of Bun is running?

1.1.12+43f0913c3

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Bun install/add still hang on resolve when packages are not in cache. To simulate this remove cache. bun pm cache rm (This is because trying versions, 1.1.12 -> 1.1.8, only 1.1.8 doesn't hang on install/add packages but then after switching back to v1.1.12 it will resolve because it is in cache) (I use scoop reset bun@version to switch versions 1.1.12 -> 1.1.8)

start new bun package with bun init (will hang on bun init as well IF empty cache and need to ctrl-c to exit)

Remember to clear cache first to simulate no cache bun pm cache rm

image

Install only works with v1.1.8 when cache is empty ( or does not contain the packages needed to install) image

Now that it installed with v1.1.8, going back to v1.1.12 will work. Note in v1.1.12 removing node_modules and bun i will work. BUT if cache is removed via bun pm cache rm. Then bun will hang again in bun i image

Same for adding any packages image

I don't think the previous bug https://github.com/oven-sh/bun/issues/11413 is solved

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

cpakken avatar Jun 01 '24 18:06 cpakken

This issue seemed to resolve once I restarted my computer. Wierd!

cpakken avatar Jun 01 '24 19:06 cpakken

This issue seems reoccurring after using bun for a bit...

When it hangs on resolving... it seems to proceed after ~2 minutes.

cpakken avatar Jun 02 '24 08:06 cpakken

I'm having the same issue on macOS 14.4.1 (23E224). bun install is stuck on Resolving [1/1] (the types for bun).

restarting didn't help

running bun install --no-cache fixed the issue

nicu-chiciuc avatar Jun 16 '24 16:06 nicu-chiciuc

Actually, I was wrong, it seemed to work because before running bun install --no-cache I've ran npm install. Removing node_modules and the locks and running bun install --no-cache again also gets stuck.

nicu-chiciuc avatar Jun 16 '24 16:06 nicu-chiciuc

Same stuck on EC2 AWS

dm1tryG avatar Jul 19 '24 15:07 dm1tryG

Got the same problem on Ubuntu where bun was installed from SNAPs

Resolved by uninstall bun from SNAP: sudo snap remove bun-js and install from the official website

egorsmkv avatar Aug 20 '24 09:08 egorsmkv

I’m having this issue right now and I have installed bun following guidelines on the official site for MacOS.

kwiat1990 avatar Oct 22 '24 19:10 kwiat1990

This issue still persists at 1.1.42 and is somewhat inconsistent. On window startup / restart, bun install, bun add seems to work without getting stuck. But something happens and bun add / install just hangs on resolves for 120 + seconds. The issue resolves if I restart windows again, but then an hour or two later this issue emmerges

cpakken avatar Dec 25 '24 20:12 cpakken

From https://github.com/oven-sh/bun/issues/5831 seems like the issue will resolve if ipv6 is disabled.

bun install commands should work with ipv6 though.

cpakken avatar Dec 25 '24 20:12 cpakken

any update?

Alecyrus avatar Jan 06 '25 18:01 Alecyrus

This issue is still happening on v1.2.0 - We are being delayed too many times because of that, someone have an easy fix besides disable ipv6?

alicercedigital avatar Jan 23 '25 18:01 alicercedigital

on MacOS, latest bun at the moment, having no cache.

$ bun i --verbose
bun install v1.2.2 (c1708ea6)
Loaded 263 hoisted_dependencies
Loaded 383 resolutions
Loaded 383 dependencies
Loaded 8 extern_strings
Loaded 23016 string_bytes
Workspace package "..." has added 0 dependencies, removed 0 dependencies, and updated 2 dependencies
Enqueue package manifest for download: @arethetypeswrong/cli
Enqueue package manifest for download: @types/bun
Enqueue package manifest for download: semver
Enqueue package manifest for download: tsdown
Enqueue package manifest for download: typescript
Enqueue package manifest for download: @emotion/styled
Enqueue package manifest for download: @mui/material
Enqueue package manifest for download: react
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
[PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
  🔍 Resolving [1/8] [PackageManager] waiting for 8 tasks
[PackageManager] waiting for 8 tasks
...

RobinTail avatar Feb 09 '25 08:02 RobinTail

I just spent some hours chasing this. Disabling IPv6 worked temporarily, but my home network was the root cause. Simply yoinking the modem+router from the wall and restarting them fixed everything. Seems Chrome (and curl?) are smart enough to fall back to IPv4 automatically so the internet connection appears to work, but simpler utilities (wget, bun install, gem install) will just hang forever.

luisfonsivevo avatar Mar 24 '25 19:03 luisfonsivevo

Can confirm it's related to IPV6 and still occurs with v1.2.8 :/ Easy / fast fix i found for now: enable / toggle a VPN (like WARP) and try commands again

DamChtlv avatar Apr 04 '25 15:04 DamChtlv

Having the same problem. Bun seems to stuck in resolving after using it for sometimes. Restarting the machine solve the problem for me.

prakarangs avatar Apr 05 '25 08:04 prakarangs

Resolved on my end by disabling IPv6.

phil-flip avatar Apr 15 '25 18:04 phil-flip

Facing the same issue, I disable and enable IPv6 on mac

fomotrader avatar Apr 16 '25 11:04 fomotrader

Same issues on windows 11 using command: bunx --bun shadcn@latest add tabs stuck at 577 or 559, gets stuck at some package and never continues

Zekee69 avatar Jun 23 '25 08:06 Zekee69

Same for me on Fedora 42 with bun version 1.2.18 and I've disabled ipv6 and immediately worked even without retrying the command

dardourimohamed avatar Jul 16 '25 14:07 dardourimohamed

I also encountered this problem in Linux, using version v1.2.21. Is there any solution other than disabling IPv6?

bili-jing avatar Aug 27 '25 15:08 bili-jing

Same issue here!

igoroctaviano avatar Sep 05 '25 18:09 igoroctaviano

Same issue here.

mylinuxforwork avatar Sep 09 '25 13:09 mylinuxforwork

Same issue here Windows 11 with v1.2.23. I tried bun install --no-cache and it works for me.

Here are some logs when I just run bun install.

❯ bun install --verbose
bun install v1.2.23 (cf136713)
Enqueue package manifest for download: @tsconfig/node22
   - "@types/node": "^22.18.6" - @types/[email protected]
Enqueue package manifest for download: @vitejs/plugin-vue
Enqueue package manifest for download: @vue/tsconfig
Enqueue package manifest for download: npm-run-all2
Enqueue package manifest for download: typescript
Enqueue package manifest for download: vite
Enqueue package manifest for download: vite-plugin-vue-devtools
Enqueue package manifest for download: vue-tsc
   - "vue": "^3.5.22" - [email protected]
Enqueue package manifest for download: undici-types
   - "@vue/shared": "3.5.22" - @vue/[email protected]
   - "@vue/runtime-dom": "3.5.22" - @vue/[email protected]
   - "@vue/compiler-dom": "3.5.22" - @vue/[email protected]
   - "@vue/compiler-sfc": "3.5.22" - @vue/[email protected]
   - "@vue/server-renderer": "3.5.22" - @vue/[email protected]
Enqueue package manifest for download: csstype
   - "@vue/reactivity": "3.5.22" - @vue/[email protected]
   - "@vue/runtime-core": "3.5.22" - @vue/[email protected]
   - "@vue/compiler-core": "3.5.22" - @vue/[email protected]
Enqueue package manifest for download: @babel/parser
Enqueue package manifest for download: estree-walker
Enqueue package manifest for download: magic-string
Enqueue package manifest for download: postcss
Enqueue package manifest for download: source-map-js
   - "@vue/compiler-ssr": "3.5.22" - @vue/[email protected]
Enqueue package manifest for download: entities
  🔍 Resolving [1/16] [fetch] > HTTP/1.1 GET https://registry.npmjs.org/@tsconfig%2fnode22
[fetch] > If-None-Match: W/"10c44e06426e16274077100c3490c9cf"
[fetch] > Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.2.23
[fetch] > Host: registry.npmjs.org
[fetch] > Accept-Encoding: gzip, deflate, br, zstd

[fetch] > HTTP/1.1 GET https://registry.npmjs.org/@vitejs%2fplugin-vue
[fetch] > If-None-Match: W/"eee5f9211745cd09238eb41d22d0da3f"
[fetch] > Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.2.23
[fetch] > Host: registry.npmjs.org
[fetch] > Accept-Encoding: gzip, deflate, br, zstd

...[Omitted similar logs]...

[fetch] < 200 Connection established

[fetch] < 200 Connection established

...[Omitted similar logs]...

[fetch] < 304 Not Modified
[fetch] < Date: Thu, 02 Oct 2025 03:11:38 GMT
[fetch] < Connection: keep-alive
[fetch] < CF-Ray: 9881037c79691fbb-HKG
[fetch] < CF-Cache-Status: HIT
[fetch] < Access-Control-Allow-Origin: *
[fetch] < Age: 82
[fetch] < Cache-Control: public, max-age=300
[fetch] < ETag: "992114659dee36a749643069d6b09582"
[fetch] < Last-Modified: Wed, 01 Oct 2025 07:14:44 GMT
[fetch] < Vary: Accept-Encoding
[fetch] < Set-Cookie: _cfuvid=[REDACTED]; path=/; domain=.npmjs.org; HttpOnly; Secure; SameSite=None
[fetch] < Server: cloudflare

[fetch] < 304 Not Modified
[fetch] < Date: Thu, 02 Oct 2025 03:11:38 GMT
[fetch] < Connection: keep-alive
[fetch] < CF-Ray: 9881037c7f9e0ec8-HKG
[fetch] < CF-Cache-Status: HIT
[fetch] < Access-Control-Allow-Origin: *
[fetch] < Age: 99
[fetch] < Cache-Control: public, max-age=300
[fetch] < ETag: "2c833ce37ddf03db0f85ef208f666500"
[fetch] < Last-Modified: Tue, 09 Sep 2025 12:52:41 GMT
[fetch] < Vary: Accept-Encoding
[fetch] < Set-Cookie: _cfuvid=[REDACTED]; path=/; domain=.npmjs.org; HttpOnly; Secure; SameSite=None
[fetch] < Server: cloudflare

...[Omitted similar logs]...

Relevant Issues:

  • https://github.com/oven-sh/bun/issues/5831
  • https://github.com/oven-sh/bun/issues/20886

oolongcha024 avatar Oct 02 '25 07:10 oolongcha024

WSL2 user here, Ubuntu 24, started encountering this issue from one day to the next without changing anything anywhere. Did a clean install shortly before I left my computer, worked fine. Hop on my computer the next day, boom, hit with this issue here.

Infinitely stuck on resolving, nothing works. Upgraded bun, restarted the computer - still broken.

Then I read about disabling IPv6 and added this to my .wslconfig

[wsl2]
kernelCommandLine=ipv6.disable=1

restarted wsl and now its working again

0tii avatar Oct 02 '25 13:10 0tii

Duplicate of #4938

chetan avatar Dec 09 '25 14:12 chetan