oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.34k stars 2.7k forks source link

Windows: Bun install fails to download when $Env:http_proxy is set #9072

Closed ZTL-UwU closed 3 weeks ago

ZTL-UwU commented 7 months ago

What version of Bun is running?

1.0.29

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. Set $Env.http_proxy in $PROFILE e.g. $Env:http_proxy = "http://127.0.0.1:7890"; $Env:https_proxy = "http://127.0.0.1:7890"
  2. Init a bun project
  3. Add some dependencies.

e.g.

bun init
bun add react

What is the expected behavior?

Dependencies being installed correctly.

What do you see instead?

bun add v1.0.29-canary.22 (5147c0ba)
  πŸ” @types/bun [11/12]
error: Syscall downloading package manifest @types/bun
  πŸ” @types/bun [11/12]
error: Syscall downloading package manifest react
  πŸ” typescript [18/18]
error: Syscall downloading package manifest typescript
error: @types/bun@latest failed to resolve
error: react@ failed to resolve

Additional information

With --verbose:

Details

``` bun add v1.0.29-canary.22 (5147c0ba) Enqueue package manifest for download: @types/bun [0.00ms] [cache hit] react Enqueue package manifest for download: react πŸ” Resolving [1/2] [PackageManager] waiting for 2 tasks Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Request: GET /react If-None-Match: W/"d13fe651ecc5eadfbb486c6b999d9db2" Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established πŸ” @types/bun [11/12] error: Response: < 200 Connection established Syscall downloading package manifest @types/bun πŸ” react [12/12] error: Syscall downloading package manifest react Enqueue package manifest for download: typescript Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.0.29 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established πŸ” typescript [18/18] error: Syscall downloading package manifest typescript warn: warn: Syscall downloading package manifest @types/bun warn: warn: Syscall downloading package manifest react warn: warn: Syscall downloading package manifest @types/bun warn: warn: Syscall downloading package manifest react warn: warn: Syscall downloading package manifest @types/bun warn: warn: Syscall downloading package manifest react warn: warn: Syscall downloading package manifest @types/bun warn: warn: Syscall downloading package manifest react warn: warn: Syscall downloading package manifest @types/bun warn: warn: Syscall downloading package manifest react warn: warn: Syscall downloading package manifest typescript warn: warn: Syscall downloading package manifest typescript warn: warn: Syscall downloading package manifest typescript warn: warn: Syscall downloading package manifest typescript warn: warn: Syscall downloading package manifest typescript error: @types/bun@latest failed to resolve error: react@ failed to resolve ```

aihuasxy commented 5 months ago

same problem with me!

bun install v1.1.0 (5903a614) Enqueue package manifest for download: @types/bun πŸ” Resolving [1/1] [PackageManager] waiting for 1 tasks Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, / Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br

Response: < 200 Connection established

thatsgolden commented 5 months ago

the same goes for Clash users:

bun install v1.1.0 (5903a614) info: cannot move files from tempdir: RenameAcrossMountPoints, using fallback Enqueue package manifest for download: @types/bun πŸ” Resolving [1/1] [PackageManager] waiting for 1 tasks Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /@types%2fbun Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established πŸ” @types/bun [6/6] error: Syscall downloading package manifest @types/bun Enqueue package manifest for download: typescript Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established Request: GET /typescript Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */* Connection: keep-alive User-Agent: Bun/1.1.0 Host: registry.npmjs.org Accept-Encoding: gzip, deflate, br Response: < 200 Connection established πŸ” typescript [12/12] error: Syscall downloading package manifest typescript warn: Syscall downloading package manifest @types/bun warn: Syscall downloading package manifest @types/bun warn: Syscall downloading package manifest @types/bun warn: Syscall downloading package manifest @types/bun warn: Syscall downloading package manifest @types/bun warn: Syscall downloading package manifest typescript warn: Syscall downloading package manifest typescript warn: Syscall downloading package manifest typescript warn: Syscall downloading package manifest typescript warn: Syscall downloading package manifest typescript Clean lockfile: 1 packages - 1 packages in 57.4us error: @types/bun@latest failed to resolve
manudss commented 5 months ago

I have the same problem. Http_proxy was settled. And I need to have it settled, are under corporate proxy, cannot do without it.

zhuweiyou commented 5 months ago

same issue

bun install v1.1.2 (c8d072c2)
  πŸ” vite [11/12]
error: Syscall downloading package manifest vite
aihuasxy commented 5 months ago

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

ZTL-UwU commented 5 months ago

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

I believe you can run the bun install script for bun itself without setting the proxy.

aihuasxy commented 5 months ago

I would like to help pinpoint this issue, but I'm unsure where to start. I'm ready to compile 'bun' locally and then debug it, but since the compilation process for 'bun' also requires 'bun install', it becomes a chicken-and-egg problem.

I believe you can run the bun install script for bun itself without setting the proxy.

(base) PS E:\github\bun> bun install bun install v1.1.2 (c8d072c2) πŸ” Resolving... error: Syscall downloading tarball scheduler@0.24.0-canary-09fbee89d-20231013 πŸ” Resolving... error: Syscall downloading tarball ignore@5.2.4 πŸ” Resolving... error: Syscall downloading tarball @eslint/js@8.51.0 πŸ” Resolving... error: Syscall downloading tarball no-case@3.0.4 . . .

ZTL-UwU commented 5 months ago

Is $Env:http_proxy present in your Powershell's $PROFILE?

aihuasxy commented 5 months ago

Is $Env:http_proxy present in your Powershell's $PROFILE?

Yes http_proxy and https_proxy in both $Env and file $PROFILE. BTW: I'm using the company network, which has a firewall, and all access needs to go through the proxy.

ZTL-UwU commented 5 months ago

https://github.com/oven-sh/bun/blob/7b5065c1c9d46d838d23f0279a508d0bae3357bd/src/http.zig#L2632-L2644

The problem is with proxy.ssl.handshake(), which throws an error.Syscall.

1596944197 commented 4 months ago

https://github.com/oven-sh/bun/blob/7b5065c1c9d46d838d23f0279a508d0bae3357bd/src/http.zig#L2632-L2644

The problem is with proxy.ssl.handshake(), which throws an error.Syscall.

how to fix that?

hero commented 2 months ago

The same problem...


error: Syscall downloading tarball @types/bun@1.1.6
error: Syscall downloading tarball typescript@5.5.3
error: Syscall downloading tarball bun-types@1.1.17
error: Syscall downloading tarball @types/node@20.12.14
error: Syscall downloading tarball @types/ws@8.5.11
error: Syscall downloading tarball undici-types@5.26.5```
442283045 commented 1 month ago

same problem: ❯ bun create vue error: Syscall downloading package manifest create-vue

guyutongxue commented 3 weeks ago

Seems fixed by #12750

LeonKohli commented 2 weeks ago

Error persists for me in latest version:

 bun i tailwindcss
bun add v1.1.26 (0a37423b)
error: Syscall downloading package manifest tailwindcss
guyutongxue commented 2 weeks ago

Error persists for me in latest version:


 bun i tailwindcss

bun add v1.1.26 (0a37423b)

error: Syscall downloading package manifest tailwindcss

@LeonKohli new version with the patch not released yet πŸ˜„ you can try the canary version by bun upgrade --canary

LeonKohli commented 2 weeks ago

Oh, thought this was already in latest, thanks!