2

I can't perform yarn to install my packages.

Some of my packages are private like this:

"my-package": "git+ssh://git@mycompany.com:company/my-package#0.2.35"

It produce this error.

git@my-company.com: Permission denied (publickey,password).
fatal: Could not read from remote repository.

But I can git clone them via ssh, how do I solve this problem?

Joseph
  • 3,974
  • 7
  • 34
  • 67
  • 1
    If your ssh key is password protected, yarn will not interrupt the installation for asking the password. The only solution i am aware of is, remove the password from ssh key and try `yarn install` – Swaraj Giri May 27 '19 at 04:33

1 Answers1

3

If your default (~/.ssh/id_rsa) private SSH key is passphrase protected (passphrase, not password), then try at least to add it to the ssh agent.

As in yarnpkg/yarn issue 3942

To anyone else from the future like myself ssh-add -l -E md5 (for OpenSSH >= 6.8) seems to have cleared the issue up, while proclaiming that no identities were added.

To check which key is actually used, set GIT_SSH_COMMAND to ssh -v before your command.

Also, try and register another SSH key, this time with a legacy format (if your current key has 70 chars per line)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250