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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

git+ssh package install does not seem to work #513

Closed
Fishrock123 opened this Issue Oct 5, 2016 · 103 comments

Comments

Projects
None yet
@Fishrock123

Fishrock123 commented Oct 5, 2016

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?

yarn install v0.14.0
info No lockfile found.
[1/4] 馃攳  Resolving packages...
error Couldn't find package "<package>" on the "npm" registry.

If the current behavior is a bug, please provide the steps to reproduce.

"devDependencies": {
    "license-builder": "git+ssh://git@github.com/fishrock123/<package>.git",
}

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

@Fishrock123 Fishrock123 changed the title from git+ssh package identify does not seem to work to git+ssh package install does not seem to work Oct 5, 2016

@kittens kittens added the cat-bug label Oct 5, 2016

@kittens kittens self-assigned this Oct 5, 2016

@kittens

This comment has been minimized.

Show comment
Hide comment
@kittens

kittens Oct 5, 2016

Member

Do you have a repro that I can use verbatim? Having trouble reproducing this.

Member

kittens commented Oct 5, 2016

Do you have a repro that I can use verbatim? Having trouble reproducing this.

@Fishrock123

This comment has been minimized.

Show comment
Hide comment
@Fishrock123

Fishrock123 Oct 5, 2016

No, sorry.

It wasn't actually from my personal github though. It's "git+ssh://git@github.com/<org>/<package>.git"

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?

No, sorry.

It wasn't actually from my personal github though. It's "git+ssh://git@github.com/<org>/<package>.git"

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?

@Fishrock123

This comment has been minimized.

Show comment
Hide comment
@Fishrock123

Fishrock123 Oct 5, 2016

I will mention this happens with more than one such identifier.

I will mention this happens with more than one such identifier.

@danharper

This comment has been minimized.

Show comment
Hide comment
@danharper

danharper Oct 11, 2016

Contributor

Minimum repro:

{
  "name": "x",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
      "eslint-config-radweb": "git+https://git@github.com/radweb/eslint-config-radweb.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

The package isn't on the registry, if that makes a difference.

Contributor

danharper commented Oct 11, 2016

Minimum repro:

{
  "name": "x",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
      "eslint-config-radweb": "git+https://git@github.com/radweb/eslint-config-radweb.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

The package isn't on the registry, if that makes a difference.

@BBB

This comment has been minimized.

Show comment
Hide comment
@BBB

BBB Oct 11, 2016

This also errors when specifying a git tag (which npm allows).

Example snippet:

...
  "react-quill": "git+https://git@github.com/alexkrolick/react-quill.git#v2.0.1",
...

BBB commented Oct 11, 2016

This also errors when specifying a git tag (which npm allows).

Example snippet:

...
  "react-quill": "git+https://git@github.com/alexkrolick/react-quill.git#v2.0.1",
...
@adambowles

This comment has been minimized.

Show comment
Hide comment
@adambowles

adambowles Oct 11, 2016

I also get this #621

I also get this #621

@JamesHenry

This comment has been minimized.

Show comment
Hide comment
@JamesHenry

JamesHenry Oct 11, 2016

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.

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.

@BBB

This comment has been minimized.

Show comment
Hide comment
@BBB

BBB Oct 11, 2016

Looks like #573, #633 and #639 are related

BBB commented Oct 11, 2016

Looks like #573, #633 and #639 are related

@mko

This comment has been minimized.

Show comment
Hide comment
@mko

mko Oct 11, 2016

For context, from NPM's docs:

npm install <git remote url>:

Installs the package from the hosted git provider, cloning it with git. First it tries via the https (git with github) and if that fails, via ssh.

<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>]

<protocol> is one of git, git+ssh, git+http, git+https, or git+file. If no <commit-ish> is specified, then master is used.

It should also be noted that <commit-ish> is a pretty wide array of resolvable values.

A commit object or an object that can be recursively dereferenced to a commit object. The following are all commit-ishes: a commit object, a tag object that points to a commit object, a tag object that points to a tag object that points to a commit object, etc.

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, yarn is not set up to accommodate these relatively common use cases.

Easiest way to set up a repro case would be to try to install a package from a private GitHub repository using Yarn.

mko commented Oct 11, 2016

For context, from NPM's docs:

npm install <git remote url>:

Installs the package from the hosted git provider, cloning it with git. First it tries via the https (git with github) and if that fails, via ssh.

<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>]

<protocol> is one of git, git+ssh, git+http, git+https, or git+file. If no <commit-ish> is specified, then master is used.

It should also be noted that <commit-ish> is a pretty wide array of resolvable values.

A commit object or an object that can be recursively dereferenced to a commit object. The following are all commit-ishes: a commit object, a tag object that points to a commit object, a tag object that points to a tag object that points to a commit object, etc.

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, yarn is not set up to accommodate these relatively common use cases.

Easiest way to set up a repro case would be to try to install a package from a private GitHub repository using Yarn.

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@milosivanovic

milosivanovic Oct 11, 2016

If you specify the following source string:

"devDependencies": {
    "license-builder": "ssh://github.com/<user>/<package>",
}

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 git user, and in this case the local account user was used by default.

When you do specify git@ to force git to login as git to GitHub, then it fails with the usual:

error Couldn't find any versions for <package> that matches ssh://git@github.com/<user>/<package>.

So, it almost works, but doesn't support specifying the username. If your local account user happened to be called git, then it would actually succeed.

milosivanovic commented Oct 11, 2016

If you specify the following source string:

"devDependencies": {
    "license-builder": "ssh://github.com/<user>/<package>",
}

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 git user, and in this case the local account user was used by default.

When you do specify git@ to force git to login as git to GitHub, then it fails with the usual:

error Couldn't find any versions for <package> that matches ssh://git@github.com/<user>/<package>.

So, it almost works, but doesn't support specifying the username. If your local account user happened to be called git, then it would actually succeed.

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@milosivanovic

milosivanovic Oct 11, 2016

If you add the following to your ~/.ssh/config file:

Host github.com
        User git

you can force all logins to github.com via SSH to use the user git by default, and this makes yarn able to clone from private repositories when using the ssh://github.com/<user>/<package> source format.

milosivanovic commented Oct 11, 2016

If you add the following to your ~/.ssh/config file:

Host github.com
        User git

you can force all logins to github.com via SSH to use the user git by default, and this makes yarn able to clone from private repositories when using the ssh://github.com/<user>/<package> source format.

@131

This comment has been minimized.

Show comment
Hide comment
@131

131 Oct 11, 2016

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 馃槩
Also it's very usefull for forking and pointing to "before merge and npm publish" packages (e.g. http-proxy ...)

131 commented Oct 11, 2016

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 馃槩
Also it's very usefull for forking and pointing to "before merge and npm publish" packages (e.g. http-proxy ...)

@ntucker

This comment has been minimized.

Show comment
Hide comment
@ntucker

ntucker Oct 11, 2016

@milosivanovic

If you add the following to your ~/.ssh/config file:

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?

ntucker commented Oct 11, 2016

@milosivanovic

If you add the following to your ~/.ssh/config file:

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?

@kblcuk

This comment has been minimized.

Show comment
Hide comment
@kblcuk

kblcuk Oct 11, 2016

@milosivanovic @ntucker actually this worked in my particular case; I didn't had any ssh config file to start with.

kblcuk commented Oct 11, 2016

@milosivanovic @ntucker actually this worked in my particular case; I didn't had any ssh config file to start with.

@ntucker

This comment has been minimized.

Show comment
Hide comment
@ntucker

ntucker Oct 11, 2016

@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 commented Oct 11, 2016

@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.

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@milosivanovic

milosivanovic Oct 11, 2016

@ntucker the stated workaround is for private repositories. If you already have a Host github.com entry in ~/.ssh/config, then add User git to that entry and yarn will be able to clone when you specify a source string such as ssh://github.com/<user>/<package>, i.e. without "git+" and without any user specified.

milosivanovic commented Oct 11, 2016

@ntucker the stated workaround is for private repositories. If you already have a Host github.com entry in ~/.ssh/config, then add User git to that entry and yarn will be able to clone when you specify a source string such as ssh://github.com/<user>/<package>, i.e. without "git+" and without any user specified.

@ntucker

This comment has been minimized.

Show comment
Hide comment
@ntucker

ntucker Oct 11, 2016

@milosivanovic How does github know my username to do ssh auth then?

ntucker commented Oct 11, 2016

@milosivanovic How does github know my username to do ssh auth then?

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@milosivanovic

milosivanovic Oct 11, 2016

@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/

milosivanovic commented Oct 11, 2016

@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/

@silverwind

This comment has been minimized.

Show comment
Hide comment
@silverwind

silverwind Oct 11, 2016

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 yarn. Installs faster too.

https://github.com/user/repo/tarball/branch

silverwind commented Oct 11, 2016

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 yarn. Installs faster too.

https://github.com/user/repo/tarball/branch
@brokenalarms

This comment has been minimized.

Show comment
Hide comment
@brokenalarms

brokenalarms Oct 11, 2016

@milosivanovic unfortunately this workaround doesn't work for our internal urls in the format:
git+ssh://git@source.com:team-name/repo.git

If you change the initial repo to the format ssh://source.com/team-name/repo.git...

...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 commented Oct 11, 2016

@milosivanovic unfortunately this workaround doesn't work for our internal urls in the format:
git+ssh://git@source.com:team-name/repo.git

If you change the initial repo to the format ssh://source.com/team-name/repo.git...

...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!

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@milosivanovic

milosivanovic Oct 11, 2016

@brokenalarms the ssh://host.com/user/repo format is fully backwards-compatible with npm (as long as the expected user is specified in the SSH config file), but that's a fair point nonetheless.

@brokenalarms the ssh://host.com/user/repo format is fully backwards-compatible with npm (as long as the expected user is specified in the SSH config file), but that's a fair point nonetheless.

@ntucker

This comment has been minimized.

Show comment
Hide comment
@ntucker

ntucker Oct 11, 2016

I see....so they just know what user based on the ssh key then?

ntucker commented Oct 11, 2016

I see....so they just know what user based on the ssh key then?

@milosivanovic

This comment has been minimized.

Show comment
Hide comment
@svenvarkel

This comment has been minimized.

Show comment
Hide comment
@svenvarkel

svenvarkel Oct 12, 2016

I had the same problem but ntucker's solution to add User git to ~/.ssh/config helped me. At least in development environment. Will try to deploy to AWS EB now:)

I had the same problem but ntucker's solution to add User git to ~/.ssh/config helped me. At least in development environment. Will try to deploy to AWS EB now:)

@labithiotis

This comment has been minimized.

Show comment
Hide comment
@labithiotis

labithiotis Oct 12, 2016

Can confirm, that using git+ssh://git@github.com:<org>/<repo> doesn't work in yarn and changing to https://github.com:<org>/<repo> does work, but that will fail on our CI server that still uses _NPM_.

labithiotis commented Oct 12, 2016

Can confirm, that using git+ssh://git@github.com:<org>/<repo> doesn't work in yarn and changing to https://github.com:<org>/<repo> does work, but that will fail on our CI server that still uses _NPM_.

@svenvarkel

This comment has been minimized.

Show comment
Hide comment
@svenvarkel

svenvarkel Oct 12, 2016

This workaround helped me:

  1. changed my private repository URL from
git+ssh://git@host/user/private-repo.git 

to

ssh://host/user/private-repo.git
  1. Added User git to ~/.ssh/config:
Host bitbucket.org
    User git

Host github.com
    User git

svenvarkel commented Oct 12, 2016

This workaround helped me:

  1. changed my private repository URL from
git+ssh://git@host/user/private-repo.git 

to

ssh://host/user/private-repo.git
  1. Added User git to ~/.ssh/config:
Host bitbucket.org
    User git

Host github.com
    User git
@tgarbiak

This comment has been minimized.

Show comment
Hide comment
@tgarbiak

tgarbiak Oct 12, 2016

Anyone checked if workarounds work with bitbucket?

Anyone checked if workarounds work with bitbucket?

@svenvarkel

This comment has been minimized.

Show comment
Hide comment
@svenvarkel

svenvarkel Oct 12, 2016

@tgarbiak - yes, I'm using bitbucket.

@tgarbiak - yes, I'm using bitbucket.

@slooker

This comment has been minimized.

Show comment
Hide comment
@slooker

slooker Oct 12, 2016

Using BitBucket, I added this to my ~/.ssh/config:

Host stash.company.com
    port 7999
    User shawn

And used yarn to add this package:

yarn add ssh://stash.company.com:7999/~user/package.git

When I run npm install, it works fine, but when I run yarn install, I get this error:

error TypeError: Cannot read property 'endsWith' of undefined
    at removeSuffix (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/misc.js:42:14)
    at Function.parseRefs (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/git.js:447:55)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/git.js:376:24
    at next (native)
    at step (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:20
    at run (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/es6.promise.js:87:22)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/es6.promise.js:100:28
    at flush (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/_microtask.js:18:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

slooker commented Oct 12, 2016

Using BitBucket, I added this to my ~/.ssh/config:

Host stash.company.com
    port 7999
    User shawn

And used yarn to add this package:

yarn add ssh://stash.company.com:7999/~user/package.git

When I run npm install, it works fine, but when I run yarn install, I get this error:

error TypeError: Cannot read property 'endsWith' of undefined
    at removeSuffix (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/misc.js:42:14)
    at Function.parseRefs (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/git.js:447:55)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/lib/util/git.js:376:24
    at next (native)
    at step (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:20
    at run (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/es6.promise.js:87:22)
    at /Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/es6.promise.js:100:28
    at flush (/Users/slooker/.nvm/versions/node/v6.4.0/lib/node_modules/yarnpkg/node_modules/core-js/library/modules/_microtask.js:18:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
@Krisa

This comment has been minimized.

Show comment
Hide comment
@Krisa

Krisa Nov 5, 2016

The fix above does not seem to work in my case. I've forked an official Npm package in my repo, and when I give the URL of my repo, even with a / instead of :, yarn is resolving the official Repo. (official: https://github.com/TheLarkInn/angular2-template-loader, mine: https://github.com/Krisa/angular2-template-loader). I could not find a workaround (beside using Npm the time being).

Krisa commented Nov 5, 2016

The fix above does not seem to work in my case. I've forked an official Npm package in my repo, and when I give the URL of my repo, even with a / instead of :, yarn is resolving the official Repo. (official: https://github.com/TheLarkInn/angular2-template-loader, mine: https://github.com/Krisa/angular2-template-loader). I could not find a workaround (beside using Npm the time being).

@mwpastore

This comment has been minimized.

Show comment
Hide comment
@mwpastore

mwpastore Nov 8, 2016

Switching from a versioned dependency to a tarball dependency requires a yarn cache clean before it will actually unpack the tarball as the new node_module (Node v6 LTS and yarn v0.16.1).

Switching from a versioned dependency to a tarball dependency requires a yarn cache clean before it will actually unpack the tarball as the new node_module (Node v6 LTS and yarn v0.16.1).

@qballer

This comment has been minimized.

Show comment
Hide comment
@qballer

qballer Nov 8, 2016

an army of developers has voted this up, is there a way we can assist ?

qballer commented Nov 8, 2016

an army of developers has voted this up, is there a way we can assist ?

@BryanCrotaz

This comment has been minimized.

Show comment
Hide comment
@BryanCrotaz

BryanCrotaz Nov 8, 2016

@f-sign is working on it on our team. Anything you'd like help with from an army, Fl谩vio?

@f-sign is working on it on our team. Anything you'd like help with from an army, Fl谩vio?

@maybeec

This comment has been minimized.

Show comment
Hide comment
@maybeec

maybeec Nov 11, 2016

One essential part of this issue seems to be the inconsistency of package.json and yarn.lock as described by @FredyC : The package.json does not contain the git+ssh://git@ prefix, which is maintained in yarn.lock during installation. I was thinking, that yarn is prefering to look at the yarn.lock file rather than retrieving the resolution information from package.json

After editing the package.json by hand and setting the prefix, everything worked fine.

maybeec commented Nov 11, 2016

One essential part of this issue seems to be the inconsistency of package.json and yarn.lock as described by @FredyC : The package.json does not contain the git+ssh://git@ prefix, which is maintained in yarn.lock during installation. I was thinking, that yarn is prefering to look at the yarn.lock file rather than retrieving the resolution information from package.json

After editing the package.json by hand and setting the prefix, everything worked fine.

@FredyC

This comment has been minimized.

Show comment
Hide comment
@FredyC

FredyC Nov 11, 2016

@maybeec That problem is actually already solved in master branch... #1312 (comment)

FredyC commented Nov 11, 2016

@maybeec That problem is actually already solved in master branch... #1312 (comment)

@maybeec

This comment has been minimized.

Show comment
Hide comment
@maybeec

maybeec Nov 11, 2016

Well done, I am looking forward for the next release. I think it will fix a lot of issues.

maybeec commented Nov 11, 2016

Well done, I am looking forward for the next release. I think it will fix a lot of issues.

@FredyC

This comment has been minimized.

Show comment
Hide comment
@FredyC

FredyC Nov 11, 2016

Yea, I am totally doumbfounded what's the holdup with making new releases. This one is around like a month now? I guess it's some strict Facebook policy or what... 馃槩

FredyC commented Nov 11, 2016

Yea, I am totally doumbfounded what's the holdup with making new releases. This one is around like a month now? I guess it's some strict Facebook policy or what... 馃槩

@alanhogan

This comment has been minimized.

Show comment
Hide comment
@alanhogan

alanhogan Nov 11, 2016

#1784 requests a new release. Please just leave a thumbs-up reaction!

#1784 requests a new release. Please just leave a thumbs-up reaction!

@sateffen

This comment has been minimized.

Show comment
Hide comment
@sateffen

sateffen Nov 15, 2016

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 :)

sateffen commented Nov 15, 2016

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 :)

@BryanCrotaz

This comment has been minimized.

Show comment
Hide comment
@BryanCrotaz

BryanCrotaz Nov 15, 2016

#1816 may well fix this - take a look at the code changes - it certainly fixes the problem with colon after the domain

#1816 may well fix this - take a look at the code changes - it certainly fixes the problem with colon after the domain

@jlouazel

This comment has been minimized.

Show comment
Hide comment
@jlouazel

jlouazel Nov 16, 2016

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.

jlouazel commented Nov 16, 2016

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.

@viswanathamsantosh

This comment has been minimized.

Show comment
Hide comment
@viswanathamsantosh

viswanathamsantosh Nov 16, 2016

Is this issue fixed? I m trying to migrate my project from npm to yarn but still facing this issue with yarn@0.17.2 !

Is this issue fixed? I m trying to migrate my project from npm to yarn but still facing this issue with yarn@0.17.2 !

@jlouazel

This comment has been minimized.

Show comment
Hide comment
@jlouazel

jlouazel Nov 16, 2016

@viswanathamsantosh Seems to work on my side

image

jlouazel commented Nov 16, 2016

@viswanathamsantosh Seems to work on my side

image

@viswanathamsantosh

This comment has been minimized.

Show comment
Hide comment
@viswanathamsantosh

viswanathamsantosh Nov 16, 2016

looks like this is fixed here #971 !replacing colon( : ) with slash( / ) actually worked. :')

looks like this is fixed here #971 !replacing colon( : ) with slash( / ) actually worked. :')

@sateffen

This comment has been minimized.

Show comment
Hide comment
@sateffen

sateffen Nov 16, 2016

Replacing the colon with a slash doesn't work in my case :( git+ssh://git@private... still gets cut down to ssh://git@private...

Replacing the colon with a slash doesn't work in my case :( git+ssh://git@private... still gets cut down to ssh://git@private...

@blond blond referenced this issue Nov 16, 2016

Closed

Yarn vs NPM #192

@martynchamberlin

This comment has been minimized.

Show comment
Hide comment
@martynchamberlin

martynchamberlin Nov 16, 2016

Yes I'm still having this problem too, even with version 0.17.2 of Yarn. The git+ part gets removed and I end up with:

Permission denied (publickey).
fatal: Could not read from remote repository.

Given that it's working for some people though makes me confused. Any idea what we're doing wrong?

Yes I'm still having this problem too, even with version 0.17.2 of Yarn. The git+ part gets removed and I end up with:

Permission denied (publickey).
fatal: Could not read from remote repository.

Given that it's working for some people though makes me confused. Any idea what we're doing wrong?

@qballer

This comment has been minimized.

Show comment
Hide comment
@qballer

qballer Nov 16, 2016

place this in ~/.ssh/config

Host github.com
        User git

qballer commented Nov 16, 2016

place this in ~/.ssh/config

Host github.com
        User git
@martynchamberlin

This comment has been minimized.

Show comment
Hide comment
@martynchamberlin

martynchamberlin Nov 16, 2016

Yes! That fixed it for me. Thanks.

It'd be nice though if cleanUrl were not getting run, so we could have this directly in the URL instead. Having to change a configuration file requires a devops change where we could otherwise have version control handling it. Not sure what the thought process behind this was...?

Yes! That fixed it for me. Thanks.

It'd be nice though if cleanUrl were not getting run, so we could have this directly in the URL instead. Having to change a configuration file requires a devops change where we could otherwise have version control handling it. Not sure what the thought process behind this was...?

@DominicBoettger

This comment has been minimized.

Show comment
Hide comment
@DominicBoettger

DominicBoettger Nov 16, 2016

Same problem here. Urls of private repositories are not working as before (npm).

git+ssh://git@github.com:ORG/repo.git should work as it's needed to be compatible with npm during the migration phase...

Same problem here. Urls of private repositories are not working as before (npm).

git+ssh://git@github.com:ORG/repo.git should work as it's needed to be compatible with npm during the migration phase...

@martynchamberlin

This comment has been minimized.

Show comment
Hide comment
@martynchamberlin

martynchamberlin Nov 16, 2016

@DominicBoettger Once you've added User git to your ~/.ssh/config you'll also want to change that colon to a forward slash. In my experience today, Yarn doesn't play well with the colon yet.

git+ssh://github.com/ORG/repo.git

@DominicBoettger Once you've added User git to your ~/.ssh/config you'll also want to change that colon to a forward slash. In my experience today, Yarn doesn't play well with the colon yet.

git+ssh://github.com/ORG/repo.git
@sarus

This comment has been minimized.

Show comment
Hide comment
@sarus

sarus Nov 17, 2016

dependencies of the form

git+ssh://git@bitbucket.org:myuser/repo.git#v1.0.0",

do not work for me with the latest yarn 017.2. The error is:

ssh: Could not resolve hostname bitbucket.org:myuser: Name or service not known

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?

sarus commented Nov 17, 2016

dependencies of the form

git+ssh://git@bitbucket.org:myuser/repo.git#v1.0.0",

do not work for me with the latest yarn 017.2. The error is:

ssh: Could not resolve hostname bitbucket.org:myuser: Name or service not known

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?

@BryanCrotaz

This comment has been minimized.

Show comment
Hide comment

@sarus PR #1816 will fix this

@DominicBoettger

This comment has been minimized.

Show comment
Hide comment
@DominicBoettger

DominicBoettger Nov 17, 2016

Please merge PR #1816 and publish a new version 馃憤

Please merge PR #1816 and publish a new version 馃憤

@vsantosu

This comment has been minimized.

Show comment
Hide comment
@vsantosu

vsantosu Dec 4, 2016

Merge? Someone? NPM IS DRIVING ME NUTS!! Please merge and release :(

vsantosu commented Dec 4, 2016

Merge? Someone? NPM IS DRIVING ME NUTS!! Please merge and release :(

@vichle

This comment has been minimized.

Show comment
Hide comment
@vichle

vichle Dec 5, 2016

This issue remains in v0.18.0.

Calling yarn install in a clean project, without node_modules and yarn.lock file works. Calling it again straight after will result in the "Could not resolve hostname" error.

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!

vichle commented Dec 5, 2016

This issue remains in v0.18.0.

Calling yarn install in a clean project, without node_modules and yarn.lock file works. Calling it again straight after will result in the "Could not resolve hostname" error.

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!

@regou

This comment has been minimized.

Show comment
Hide comment
@regou

regou Dec 16, 2016

This issue is the very one which stops many developers to use yarn.
We need take this issue seriously

regou commented Dec 16, 2016

This issue is the very one which stops many developers to use yarn.
We need take this issue seriously

@vsantosu

This comment has been minimized.

Show comment
Hide comment
@vsantosu

vsantosu Dec 16, 2016

@regou totally agree man... This is the only reason I cannot use Yarn...

@regou totally agree man... This is the only reason I cannot use Yarn...

@FredyC

This comment has been minimized.

Show comment
Hide comment
@FredyC

FredyC Dec 16, 2016

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...

FredyC commented Dec 16, 2016

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...

@BryanCrotaz

This comment has been minimized.

Show comment
Hide comment
@BryanCrotaz

BryanCrotaz Dec 16, 2016

Please everyone we have a fix for this in #1816 that Flavio and I spent around ten days on.

However a different set of tests fails depending on where the tests are run.

Please run the tests on your machine and report on #1816 what results you got and what your OS and node version is

Please everyone we have a fix for this in #1816 that Flavio and I spent around ten days on.

However a different set of tests fails depending on where the tests are run.

Please run the tests on your machine and report on #1816 what results you got and what your OS and node version is

@torifat

This comment has been minimized.

Show comment
Hide comment
@torifat

torifat Dec 16, 2016

Member

Thanks @FredyC & @BryanCrotaz for point everyone to #1816. I'm locking this thread for the time being.

Member

torifat commented Dec 16, 2016

Thanks @FredyC & @BryanCrotaz for point everyone to #1816. I'm locking this thread for the time being.

@yarnpkg yarnpkg locked and limited conversation to collaborators Dec 16, 2016

@bestander

This comment has been minimized.

Show comment
Hide comment
@bestander

bestander Jan 18, 2017

Member

Fixed via #2384

Member

bestander commented Jan 18, 2017

Fixed via #2384

@bestander bestander closed this Jan 18, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.