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

Install from private github url #573

Closed
jamiebuilds opened this issue Oct 10, 2016 · 38 comments
Closed

Install from private github url #573

jamiebuilds opened this issue Oct 10, 2016 · 38 comments

Comments

@jamiebuilds
Copy link
Contributor

Do you want to request a feature or report a bug? Bug

What is the current behavior?

You can't install a package like github:yarnpkg/yarn because it is private even though if

[2/4] 🚚  Fetching packages...
error git@github.com:yarnpkg/yarn.git: Tarball is not in network and can not be located in cache (/Users/thejameskyle/Projects/yarn-perf/git@github.com:yarnpkg/yarn.git)

What is the expected behavior?

It should be able to install the package like npm currently can.

@doot0
Copy link

doot0 commented Oct 11, 2016

This is also the case for private URLs that require basic authentication, e.g. git+https://gitusername:gitpassword@server/path/to/repo.git.

@milosivanovic
Copy link

milosivanovic commented Oct 11, 2016

I've provided a simple workaround for authenticating via SSH in yarn at #513 (comment) that you can use until this issue is fixed.

ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 13, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 13, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 14, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 15, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 17, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 18, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 19, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 24, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 27, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 27, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 27, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 28, 2016
ramasilveyra added a commit to ramasilveyra/yarn that referenced this issue Oct 28, 2016
@martynchamberlin
Copy link

Looks like @ramasilveyra closed #971 in deference to #1081, but that PR didn't actually fix the problem, at least for me. I'm manually grabbing a non-published bleeding-edge version of yarn so that it will have #1081 in it, but I'm still getting this error:

Tarball is not in network and can not be located in cache [...]

Any suggestions what to change to get this to work?

@martynchamberlin
Copy link

Eh, ignore my comment. I had universally installed a stable release version of yarn and due to how my VM is setup, this was the one it was referencing instead of the bleeding-edge local version. So that's why I was getting that error. I've confirmed I no longer get that error on the latest version.

@balthazar
Copy link

Sorry for the close, I don't think this is resolved by my PR

@bestander bestander reopened this Feb 8, 2017
mnsn pushed a commit to mnsn/yarn that referenced this issue Feb 15, 2017
* Fix private urls using colon separator

Closes yarnpkg#573, closes yarnpkg#2416.

Related to yarnpkg#2384, yarnpkg#573.

* Remove unused suppression

* Move to dedicated method & add tests
kornelski added a commit to kornelski/yarn that referenced this issue Mar 25, 2017
kornelski added a commit to kornelski/yarn that referenced this issue Apr 3, 2017
arcanis pushed a commit that referenced this issue Apr 3, 2017
…ers (#2990)

* Non-nullable git supportsArchiveCache

* Git URLs are not real URLs, they also support scp host specifiers

Fixes #1796

* Remove workaround replacing ':' in git URLs

(#573, #1796)

* Expect already-parsed URL in Git constructor
@ramasilveyra
Copy link
Contributor

ramasilveyra commented May 16, 2017

#2992 added support for private git repos when using shorted repo syntax (this landed on v0.24.0).

The generation for the first time of a yarn.lock file works well, but then with a yarn.lock file if you try rm -rf node_modules && yarn fails with this error:

error An unexpected error occurred: "Invalid protocol: git+ssh:".

That error comes from https://github.com/request/request/blob/b12a6245d9acdb1e13c6486d427801e123fdafae/request.js#L455 and I think (im not sure, still looking to the code trying to understand) it's because yarn tries to use the tarball fetcher instead of the git fetcher.

Update

The offline feature/fix added recently makes the git resolver defaults to the tarball to avoid http calls https://github.com/yarnpkg/yarn/pull/3000/files
Returning the git shrunk if is possible seems to fix the issue look the last commit at https://github.com/ramasilveyra/yarn/tree/fix-private-deps

@bestander
Copy link
Member

@ramasilveyra, do you have a PR in mind that could fix it?

@ramasilveyra
Copy link
Contributor

@bestander Hey I just created a pr with the fix #3425, but I'm not sure if it's the best solution.

@chamini2
Copy link

This could be closed now, right?

@bilby91
Copy link

bilby91 commented May 26, 2017

Last version fixes the problem.

@arcanis arcanis closed this as completed May 26, 2017
@gsklee
Copy link
Contributor

gsklee commented Jun 13, 2017

Just tried it and it doesn't work (github repo shorthand with private repo); it prompted me to enter my ssh key's passphrase but I cannot actually enter anything at all.

@gsklee
Copy link
Contributor

gsklee commented Jun 14, 2017

Answering myself: #2992 (comment)

BYK pushed a commit that referenced this issue Oct 26, 2017
**Summary**

Yarn can not handle the `git+https://` dependency format correctly, as described for various versions in #1625. The problem is present in Yarn 1.2.1.

A related problem for `git+ssh://` has been described in #573 and fixed in #3425.

This PR extends the solution from #3425 to use the Git fetcher for any [Git-over-protocol](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) URLs.

**Test plan**

Extended the `package-request` unit tests to verify that the correct remote type (git) is used for `git+https://`, while the tarball remote type continues to be used for regular HTTP(S) URLs.
joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…g#4759)

**Summary**

Yarn can not handle the `git+https://` dependency format correctly, as described for various versions in yarnpkg#1625. The problem is present in Yarn 1.2.1.

A related problem for `git+ssh://` has been described in yarnpkg#573 and fixed in yarnpkg#3425.

This PR extends the solution from yarnpkg#3425 to use the Git fetcher for any [Git-over-protocol](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols) URLs.

**Test plan**

Extended the `package-request` unit tests to verify that the correct remote type (git) is used for `git+https://`, while the tarball remote type continues to be used for regular HTTP(S) URLs.
@onury
Copy link

onury commented Dec 3, 2017

This still doesn't work with yarn 1.3.2

Works —> npm i --save github:org/repo
Doesn't Work —> yarn add github:org/repo Got error: Permission denied (publickey)

macOS v10.13.1
Node v8.9.1
Yarn v1.3.2
npm v5.5.1

@jherdman
Copy link

This is definitely broken still, even with long form Git URLs.

@JoshuaCWebDeveloper
Copy link

I can confirm that the following do not work on Yarn 1.3.2 but do work on NPM:
yarn add github:org/repo
yarn add ssh://github.com/org/repo.git
yarn add ssh://git@github.com/org/repo.git
yarn add git+ssh://git@github.com/org/repo.git

However, using HTTPS does work on yarn:
yarn add https://github.com/org/repo.git

Unfortunately, in my case, there are dependencies that use some of the above formats, so it looks like I cannot use yarn until this issue is fixed.

@Schlammsuhler
Copy link

if you added you public key to your github account this works:
yarn add ssh://git@github.com:yarnpkg/yarn.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests