question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Cannot install module from git repositories with SSH

See original GitHub issue
  • I’d be willing to implement a fix

Describe the bug

I tried to migrate Yarn v2 from v1. I have two packages stored in the private git repository(GitLab). It could be installed with Yarn v1 without any problem. Here is the part of the package.json file.

"dependencies": {
    "my-engine": "git+ssh://git@gitlab.my-site.io:my-project/my-engine.git#4.2.1",
}

However, after upgrading to yarn@berry and running yarn command, I’ve got the error like below.

Screen Shot 2020-01-28 at 11 42 34

Or installing from CLI also failed.

Screen Shot 2020-01-28 at 11 51 45

When I changeed the target repository url to git+https, It worked but I had to log in my private repository from CLI, which is not a proper case for me in favor of CI configuration.

To Reproduce

  • Try to install module from any repository with SSH.
    • Adding module directly in the package.json file.
    • Using yarn add command.

Environment if relevant (please complete the following information):

  • OS: [macOS 10.15.2]
  • Node version [12.13.0]
  • Yarn version [2.0.0-rc.27]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Webslungcommented, Mar 5, 2020

I came across this same issue, dug into the gitUtils and realized you can just do an git@ in the path like: git@domain:location/of/repo.git. Worked like a charm after that.

0reactions
yarnbotcommented, Jun 9, 2020

Hi! 👋

This issue looks stale, and doesn’t feature the reproducible label - which implies that you didn’t provide a working reproduction using Sherlock. As a result, it’ll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we’re a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolution faster). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it’s a Windows-only issue), a maintainer will have to manually add the upholded label.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building private GitHub repositories with sub-modules
The problem arises when sub-modules refer private Git repositories which cannot be cloned without authentication and as a result you get stalled build....
Read more >
unable to install go module (private nested repository) - GitLab
Summary. When using go modules, I cannot install a module - private gitlab repository that is nested within a subgroup.
Read more >
Cannot install an npm dependency through a private github ...
I am trying to add an npm dependency from a private github repository. ... "some-module": "git+ssh://git@github.com:user/some-module.git#dev",.
Read more >
Private repo, git clone succeeds, npm install fails
If I clone the repo then npm install in the cloned directory then everything is fine -- so that shouldn't be the problem...
Read more >
npm install is unable to fetch dependencies because ssh ...
I'm using ssh keys to access git repos, defined in VCS for the given project. Cloning is done from a private github repos...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found