Host key verification failed from github during install dependencies

Managed flow, eas-cli/5.2.0 darwin-x64 node-v18.0.0 (Just upgraded to v49).

The build works fine locally, and expo-doctor succeeds, but the build server seems to be unable to connect to github to get react-native-community/push-notification-ios dependency.

I had this problem locally but I copied my public ed25519 key to my github account to fix it. I have no such control over the expo build servers, of course.

Running "yarn install" in /Users/expo/workingdir/build directory
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[stderr] error Command failed.
[stderr] Exit code: 128
[stderr] Command: git
[stderr] Arguments: ls-remote --tags --heads ssh://git@github.com/react-native-community/push-notification-ios.git
[stderr] Directory: /Users/expo/workingdir/build
[stderr] Output:
[stderr] Host key verification failed.
[stderr] fatal: Could not read from remote repository.
[stderr] 
[stderr] Please make sure you have the correct access rights
[stderr] and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn install exited with non-zero code: 128

you can add an ssh key as described here: Use Git Submodules - Expo Documentation

but that shouldn’t be necessary to use this library! how do you have the dependency defined in your package.json? why not point to npm?

Good question! Here is a snippet from my package.json. I had the same issue building locally, and I’m not sure why.

...
  "dependencies": {
    "@azure/core-asynciterator-polyfill": "^1.0.2",
    "@babel/preset-env": "^7.1.6",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-community/push-notification-ios": "react-native-community/push-notification-ios",
...
}

Ah! Not sure how this happened. My yarn.lock looked as below. I removed it and re-added it. Haven’t tried the EAS build yet, but this should help. Thanks so much!

"@react-native-community/push-notification-ios@react-native-community/push-notification-ios":
  version "1.11.0"
  resolved "git+ssh://git@github.com/react-native-community/push-notification-ios.git#904a99fdfa54f25b41c0a5141b4342b8c67b9616"
  dependencies:
    invariant "^2.2.4"