-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
git+ssh package install does not seem to work #513
Comments
Do you have a repro that I can use verbatim? Having trouble reproducing this. |
No, sorry. It wasn't actually from my personal github though. It's The repo is private and I have read/write access. (This accesses it via a SSH key registered on my github account) Is there additional log output I can get somehow for you? |
I will mention this happens with more than one such identifier. |
Minimum repro:
The package isn't on the registry, if that makes a difference. |
This also errors when specifying a git tag (which npm allows). Example snippet: ...
"react-quill": "git+https://[email protected]/alexkrolick/react-quill.git#v2.0.1",
... |
I also get this #621 |
Just adding in case subtlety different/requires an additional solution to @BBB case of git tag: I am trying to install a specific commit hash with git+ssh. NPM default client supports this. |
For context, from NPM's docs:
It should also be noted that
Note: These git remote url installs also should be ensured to work across both public and private git server instances using SSH keys for server authentication, not just GitHub/GitLab/etc. You could imagine a scenario where a company uses a local git server in-house for all of their internally managed dependencies (or even private GitHub repos accessed via SSH). As of right now, Easiest way to set up a repro case would be to try to install a package from a private GitHub repository using Yarn. |
If you specify the following source string:
then it does attempt to clone the stated repository over SSH, but fails with "Permission denied (publickey)" because GitHub expects clients to login as the When you do specify
So, it almost works, but doesn't support specifying the username. If your local account user happened to be called |
If you add the following to your
you can force all logins to github.com via SSH to use the user |
This is a strong no-go for us, using git referenced repos (pointing our local gitlab EE instance) is a strong part of our workflow 😢 |
But my config already has my ssh auth credentials for github so I can access the private repos. This workaround only works for public repos, right? |
@milosivanovic @ntucker actually this worked in my particular case; I didn't had any ssh config file to start with. |
@kblcuk ah, well @milosivanovic was going around to other issues and claiming his workaround worked for those cases, so I figured this was the issue for the general problems with git urls. |
@ntucker the stated workaround is for private repositories. If you already have a |
@milosivanovic How does github know my username to do ssh auth then? |
@ntucker when communicating over SSH, GitHub expects you to log in to their servers as user "git". If you try to log in with your usual GitHub username, authentication will fail. GitHub over SSH differentiates you by your public key, not username. Reference: https://help.github.com/articles/testing-your-ssh-connection/ |
Just thought to mention because many are probably not aware of this feature. For GitHub, you can also depend on the tarball URL which works fine with
|
@milosivanovic unfortunately this workaround doesn't work for our internal urls in the format: If you change the initial repo to the format ...then it will work for the initial one...but then of course all the other internal dependencies that the first internal dependency points to breaks it, since they're all in that format. Without going through and changing all the URLs on all our repos and dependencies to the workaround format (then having to deal with it not working on npm normally), we're a bit blocked on this too. As @131 pointed out, this is a major way teams use npm internally (that I'm aware of). Looks great besides that though! |
@brokenalarms the |
#1784 requests a new release. Please just leave a thumbs-up reaction! |
My issue describes a problem, that is similar, even though not the same. I looked through the code a little, and found this interesting part, which is actually used on every git url: static cleanUrl(url): string {
return url.replace(/^git\+/, '');
} Soooo.... Can anyone tell me, what's the reason for removing the git+ for each git url passed to yarn? I don't see a real reason, and the code is lacking documentation, so maybe someone could explain the intention :) |
#1816 may well fix this - take a look at the code changes - it certainly fixes the problem with colon after the domain |
The problem seems to be fixed on yarn v0.17.0. I was able to get one of my private Github repository on a specific version. |
Is this issue fixed? I m trying to migrate my project from npm to yarn but still facing this issue with [email protected] ! |
looks like this is fixed here #971 !replacing colon( : ) with slash( / ) actually worked. :') |
Replacing the colon with a slash doesn't work in my case :( git+ssh://git@private... still gets cut down to ssh://git@private... |
Yes I'm still having this problem too, even with version 0.17.2 of Yarn. The
Given that it's working for some people though makes me confused. Any idea what we're doing wrong? |
place this in ~/.ssh/config
|
Yes! That fixed it for me. Thanks. It'd be nice though if |
Same problem here. Urls of private repositories are not working as before (npm). git+ssh://[email protected]:ORG/repo.git should work as it's needed to be compatible with npm during the migration phase... |
@DominicBoettger Once you've added
|
dependencies of the form
do not work for me with the latest yarn
Haven't tested the work arounds yet but hoping yarn will eventually support the same syntax as NPM. Should this be a new issue or is this still applicable to this issue? |
Please merge PR #1816 and publish a new version 👍 |
Merge? Someone? NPM IS DRIVING ME NUTS!! Please merge and release :( |
This issue remains in v0.18.0. Calling I discovered that removing the yarn.lock file works, so I assume that there is either something wrong in the lock file or the way that yarn clones when reading from a lock file. Hope this helps! |
This issue is the very one which stops many developers to use yarn. |
@regou totally agree man... This is the only reason I cannot use Yarn... |
People, instead of this constant yammering that nobody works on this, just watch that mentioned PR #1816 and you will see they are trying to merge it... |
Thanks @FredyC & @BryanCrotaz for point everyone to #1816. I'm locking this thread for the time being. |
Fixed via #2384 |
OP's Note: if you are also having this EXACT problem, please upvote this WITHOUT commenting.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
typical install
Please mention your node.js, yarn and operating system version.
Node.js: v6.6.1-pre
Yarn: v0.14.0 (
master
)OS: OSX 10.10.5
The text was updated successfully, but these errors were encountered: