Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement semver protocol for git dependencies in bun install #5870

Open
doloboyz opened this issue Sep 21, 2023 · 22 comments
Open

Implement semver protocol for git dependencies in bun install #5870

doloboyz opened this issue Sep 21, 2023 · 22 comments
Labels
enhancement New feature or request npm Something that relates to the npm-compatible client

Comments

@doloboyz
Copy link

What version of Bun is running?

1.0.2

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

  1. Paste the following into the terminal mkdir unw-bug && cd unw-bug && bun init

  2. Go to package.json and add the following as a dependency:

    "dependencies": {
    	"uWebSockets.js": "github:uNetworking/uWebSockets.js#semver^20.31.0"
    },
    

    Alternatively, run bun add uNetworking/uWebSockets.js

  3. Run bun install

What is the expected behavior?

Should result in successful install.

What do you see instead?

On bun add uNetworking/uWebSockets.js, the following is the output to the terminal:

🔍 Resolving [1/2]
error: InstallFailed cloning repository for uWebSockets. 🚚 uNetworking/uWebSockets.js [3/3] error: InstallFailed extracting tarball for uNetworking/uWebSockets.

error: "git clone" for "uWebSockets.js" failed

error: "git clone" for "uWebSockets.js" failed

error: "package.json" for "uNetworking/uWebSockets.js" failed to open: FileNotFound

If running bun install with the pasted dependency provided above, the following is the output:

bun install v1.0.2 (37edd5a)
🔍 Resolving [1/1]
error: InstallFailed cloning repository for uWebSockets.

error: "git clone" for "uWebSockets.js" failed

error: "git clone" for "uWebSockets.js" failed

Additional information

No response

@doloboyz doloboyz added the bug Something isn't working label Sep 21, 2023
@Electroid Electroid added the npm Something that relates to the npm-compatible client label Sep 21, 2023
@Electroid Electroid changed the title uNetworking/uWebSockets.js Installation Fails bun install fails with git dependency Sep 21, 2023
@ThomasMoritz
Copy link

@doloboyz The strange thing is if you do bun add uNetworking/uWebSockets.js#v20.31.0 it works!? (on Darwin 22.6.0 arm64 arm with Bun 1.0.2)

@doloboyz
Copy link
Author

@doloboyz The strange thing is if you do bun add uNetworking/uWebSockets.js#v20.31.0 it works!? (on Darwin 22.6.0 arm64 arm with Bun 1.0.2)

Seems to still fail for me on m1 macbook pro on Ventura 13.5. Going to upgrade to 13.6 tonight, but I highly doubt thats going to fix the issue.

@dpnova
Copy link

dpnova commented Oct 4, 2023

Have spotted the same issue running: bun add @graphql-mesh/cli graphql

FYI @ardatan

@farabi-brighte
Copy link

Have spotted the same issue running: bun add @graphql-mesh/cli graphql

Same issue here. Trying to build graphql mesh with Bun.

@riki137
Copy link

riki137 commented Oct 10, 2023

We're having the same issue with : "[email protected]/..." dependency which stops us from migrating to bun.

bun add v1.0.4 (745b6b94)
  🚚 chooze [2/3] error: InstallFailed extracting tarball for choo

error: ZlibError decompressing "chooze"

@peniqliotuv
Copy link

Same thing with @types/chai

❯ bun install
bun install v1.0.7 (b0393fba)
  🔍 read-package-json-fast [765/1763]


error: "git clone" for "@types/chai" failed


error: "git clone" for "@types/chai" failed

@subodhpareek18
Copy link

I have a private github repository as a dependency in the format like this

{
  "dependencies": {
     "REPO": "https+git://[email protected]/ORG/REPO.git"
  }
}

It works when doing bun add but not when doing bun install

@subodhpareek18
Copy link

subodhpareek18 commented Nov 20, 2023

Is there a way to use any other package manager inside bun other than bun? I'm trying to deploy this to docker and wondering if there is a way to still use bun as a runtime. Otherwise I'll have to switch to node entirely :(

@ardatan
Copy link

ardatan commented Nov 20, 2023

I think you can use npm, yarn or pnpm then run the project using bun.

@doloboyz
Copy link
Author

I think you can use npm, yarn or pnpm then run the project using bun.

Second this. This is how I'm currently using bun as well. Once some issues are fixed, prob will migrate to bun as a package manager as well.

@XilinJia
Copy link

XilinJia commented Dec 20, 2023

With version 1.0.18, I got similar errors too. As @ardatan suggested, still having to use yarn is pretty discouraging.

@PaulRBerg
Copy link

PaulRBerg commented Dec 31, 2023

Update

Oh, I think I have figured out what's going on. Bun is unable to install git dependencies that don't provide a package.json.

I was getting this error:

solarray [2/3] error: InstallFailed extracting taerror: "package.json" for "solarray" failed to open: FileNotFound

The "solarray" repo does not have a package.json file (at the time of posting this comment).

Likewise, the dependency that @doloboyz (OP) wanted to install does not seem to have a package.json file:

https://github.com/uNetworking/uWebSockets.js/tree/750691839587a671653dc1f669fd7e000c6a33d4

Should I open a separate issue to suggest adding support for git dependencies that lack a package.json file?

Initial Report

This is a major issue because it's a blocker. I was excited to move our Node.js projects to Bun instead of Pnpm, but we can't do it because of this issue.

This is the problematic dependency:

"solarray": "github:evmcheb/solarray#0625e7e"

It's a git dependency pulled from GitHub, which can be installed and used just fine with Pnpm or Yarn.

Interestingly, Bun works with this dependency:

"forge-std": "github:foundry-rs/forge-std#v1.5.6",

So there must be something in https://github.com/evmcheb/solarray that troubles Bun. I can't put my finger on what precisely because both that repo and https://github.com/foundry-rs/forge-std are pretty similar in structure (e.g., they both have git submodules).

You can find my full error logs here. Is there any ETA for a fix?

I used Bun v1.0.20

@qcasey
Copy link

qcasey commented Jan 12, 2024

Changing the dep from ssh [email protected]:qcasey/winston-loki.git to http https://github.com/qcasey/winston-loki.git worked for me 🤷

Bun 1.0.22

@amanape
Copy link

amanape commented Jan 22, 2024

Using Bun v1.0.25

Still facing the same issue when trying to run bun add @graphql-mesh/cli graphql

Running bun add uNetworking/uWebSockets.js results in the error error: InstallFailed extracting tarball for uNetworking/uWebSockets.error: "package.json" for "uNetworking/uWebSockets.js" failed to open: FileNotFound

@fabianlema
Copy link

Using Bun v1.0.25. It still fails when you run bun install with a dependency like "xxxxx": "git+ssh://[email protected]:xxx/xx.git#xxxxxxx".

@cctv1005s
Copy link

Any updates? Still stuck in the error.

@skf-funzt
Copy link

Any updates? Still stuck in the error.

Same here, needed to switch to another package manager 😞

@medzhidov
Copy link

The same problem, anybody found the solution?

@mrguamos
Copy link

Using 1.1.4, still the same

@ali-master
Copy link

The same problem with @sinclair/typebox

bun add v1.1.4 (fbe2fe0c)
  🚚 https://registry.npmjs.org [3/3] error: InstallFailed extracting tarball for https://registry.npmjs.org
error: ZlibError decompressing "https://registry.npmjs.org" to ".3fcbbedefffbb7f5-00000001.https://registry.npmjs.org"

@ykla
Copy link

ykla commented May 30, 2024

The issue also in 1.1.10

ykla@ykla-ubuntu:~/taophilosophy.github.io$ bun -v
1.1.10

@Jarred-Sumner Jarred-Sumner changed the title bun install fails with git dependency Implement semver protocol for git dependencies in bun install Jun 26, 2024
@Jarred-Sumner
Copy link
Collaborator

The semver protocol is not supported yet for git dependencies. We are planning to add support for that. Keeping this issue open to track the status of that.

Oh, I think I have figured out what's going on. Bun is unable to install git dependencies that don't provide a package.json.

@PaulRBerg this issue has since been fixed as of Bun v1.1.13+

Using Bun v1.0.25. It still fails when you run bun install with a dependency like "xxxxx": "git+ssh://[email protected]:xxx/xx.git#xxxxxxx".

@fabianlema this has been fixed as of Bun v1.1.9 or so

The same problem with @sinclair/typebox

@ali-master were you able to reproduce this issue more than once? It reads like a network error

Same thing with @types/chai
error: "git clone" for "@types/chai" failed

@peniqliotuv this should be fixed as of Bun v1.1.13+. Please leave a comment if you still run into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request npm Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests