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

Yarn install in v1.6.0 with dependency from private repo starting with ssh+git fails "Invalid protocol: ssh+git:". #5766

Open
jariztia opened this issue May 1, 2018 · 4 comments

Comments

@jariztia
Copy link

jariztia commented May 1, 2018

Doing yarn install in v1.6.0 with a dependency from private repository, pointing to a url that starts with ssh+git fails.

[2/4] Fetching packages...
error An unexpected error occurred: "Invalid protocol: ssh+git:".

Changing it to git+ssh seems to fix the issue.

Yarn: v1.6.0
Node: v8.9.1
OS: Ubuntu

@ghost ghost assigned rally25rs May 1, 2018
@ghost ghost added the triaged label May 1, 2018
@rally25rs
Copy link
Contributor

I suppose this should be supported since git clone supports that protocol. I can't seem to actually find any git docs that list every valid possibility (git:, ssh:, git+ssh:, ssh+git:, etc...)

Should be a fairly easy fix, but as you already discovered, using git+ssh will work.

@juanca
Copy link
Contributor

juanca commented May 1, 2018

I would assume Yarn would only support the same protocols from NPM.

See https://docs.npmjs.com/files/package.json#git-urls-as-dependencies for more information.

@pmusiala
Copy link

pmusiala commented Jul 1, 2021

I would assume Yarn would only support the same protocols from NPM.

See https://docs.npmjs.com/files/package.json#git-urls-as-dependencies for more information.

This docs says about git, git+ssh, git+http, git+https, or git+file protocols. I've prepared fix for this but I'm not sure we want to add it and simply close the issue.

@juanca
Copy link
Contributor

juanca commented Jul 6, 2021

That's a good point. Seems like it's just backwards: git+ssh vs ssh+git.

I also found that a github shorthand exists in the later Yarn versions: <org>/<repo>#<branch> works without any specific protocol. It will try HTTPS and then SSH (AFAIK).

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

4 participants