EAS Build with private repositories (SSH key)?


I am trying to migrate to EAS Build, and it seems that the build process does an npm install now. Since one of my packages is from a private repository, I get the following error:

[stderr] npm ERR! code 128
[stderr] npm ERR! An unknown git error occurred
[stderr] npm ERR! command git --no-replace-objects ls-remote ssh://git@bitbucket.org/xxx/xxx.git
[stderr] npm ERR! Warning: Permanently added 'bitbucket.org,' (RSA) to the list of known hosts.
[stderr] npm ERR! git@bitbucket.org: Permission denied (publickey).
[stderr] npm ERR! fatal: Could not read from remote repository.
[stderr] npm ERR! 
[stderr] npm ERR! Please make sure you have the correct access rights
[stderr] npm ERR! and the repository exists.

I’ve search online and on the Expo docs but I do not see any mention of how to add an SSH key to the build pipeline. I’ve also tried to use HTTPS with username and password in package.json, but the same ssh error still happens (so the relevant package.json line is "xxx": "https://username:password@bitbucket.org/xxx/xxx.git",)

How do I get around this?

  • Managed workflow
  • Version: eas-cli/0.47.0
  • Expo version: 44

there is a doc about git submodules with ssh keys, but be careful if you build with --local flag it can replace your local ssh keys

Nice, thank you! It’s working perfectly.

I actually saw this but glanced over it since it was about submodules :sweat_smile:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.