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

bun install fails to git clone private Enterprise GitHub dependency #2464

Closed
privatenumber opened this issue Mar 23, 2023 · 2 comments · Fixed by #11917
Closed

bun install fails to git clone private Enterprise GitHub dependency #2464

privatenumber opened this issue Mar 23, 2023 · 2 comments · Fixed by #11917
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@privatenumber
Copy link
Contributor

privatenumber commented Mar 23, 2023

What version of Bun is running?

0.5.8

What platform is your computer?

Darwin 22.3.0 x86_64 i386

What steps can reproduce the bug?

Install with the following package.json where "@org/website-i18n" points to a private GitHub repo.

{
  "dependencies": {
    "@org/website-i18n": "github:org/website-i18n#branch-name"
  }
}

What is the expected behavior?

For it to install with the appropriate Git credentials.

What do you see instead?

It fails.

Also note, the first error message truncates the package name for some reason.

$ bun i --verbose
bun install v0.5.8 (1a25af5e)
  🔍 Resolving [1/1]
error: InstallFailed cloning repository for @org/website-i1

error: "git clone" for "@org/website-i18n" failed


error: "git clone" for "@org/website-i18n" failed

Additional information

  • Passing in --verbose doesn't provide me with more information. Here, I'm interested in seeing the git clone command & error.

  • I'm not certain this error is as a result of the repository being private. The org is an enterprise org, so it might be that the installation URL doesn't follow the typical GitHub git URL.

    The git clone command looks like this:

     git clone [email protected]:org/website-i18n.git
    
@privatenumber privatenumber added the bug Something isn't working label Mar 23, 2023
@Jarred-Sumner
Copy link
Collaborator

github: syntax is only supported for public repositories in Bun. We use the GitHub tarball api for these (I think npm does as well)

We should make the error message better though, and suggest to try with a git+ssh URL

@privatenumber
Copy link
Contributor Author

privatenumber commented Mar 23, 2023

Since the error message says "git clone" failed I think it's happening here:

"\"git clone\" for \"{s}\" failed",


I was just about to file a bug for the GitHub tarball API url. It doesn't seem to work for private repositories either:

bun install v0.5.8 (1a25af5e)
  🔍 Resolving [1/1]
GET https://api.github.com/repos/org/analytics-js/tarball/v0.8.7 - 404
error: analytics-js@github:org/analytics-js#v0.8.7 failed to resolve

I think an API token will need to be passed in to access private repositories via GitHub API. It works with npm and I haven't configured a token so I think they're using the Git+SSH method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants