Host key verification failed. fatal: Could not read from remote repository.

I’m using a bare workflow, my EAS version is: eas-cli/0.47.0. When I try running the command eas build it returns this error message about “Host key verification failed”. I have tried using expo build:ios and this works. How can I solve this issue?

yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git@github.com/wix/react-native-interactable.git
Directory: /Users/expo/workingdir/build

Output:

Host key verification failed.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn exited with non-zero code: 128

Could you share your package.json? From the logging, it seems there might be a dependency listed that points directly at Github using an SSH url, but you might not have set up an SSH key.

It’s complaining about the host key, not the user’s key.

I think it’s possibly best to switch to HTTPS if possible. Otherwise, see How to use git submodules which has a script that uses ssh-keyscan to add GitHub’s host key to ~/.ssh/known_hosts.

Note: It would be more secure to find GitHub’s public host keys and hard code them in a script like this instead of trusting that there’s no man in the middle feeding a bad key to ssh-keyscan.

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.5",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/react-native-fontawesome": "^0.2.6",
    "@react-native-async-storage/async-storage": "^1.16.1",
    "@react-native-community/datetimepicker": "^3.5.2",
    "@react-native-community/netinfo": "^7.1.9",
    "@react-native-firebase/app": "^12.0.0",
    "@react-native-firebase/auth": "^12.0.0",
    "@react-native-picker/picker": "^2.2.1",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-bottom-tabs": "^5.3.15",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "aws-amplify": "^4.3.14",
    "aws-amplify-react-native": "^6.0.2",
    "expo": "~41.0.1",
    "expo-auth-session": "^3.2.3",
    "expo-facebook": "^11.0.5",
    "expo-image-picker": "^10.1.4",
    "expo-random": "^11.1.2",
    "expo-status-bar": "~1.0.4",
    "expo-updates": "~0.5.4",
    "firebase": "^8.6.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-async-storage": "^0.0.1",
    "react-native-card-stack-swiper": "^1.2.5",
    "react-native-datepicker": "^1.7.2",
    "react-native-drawer": "^2.5.1",
    "react-native-facebook-keyframes": "^1.0.1",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-interactable": "github:wix/react-native-interactable#master",
    "react-native-paper": "^4.9.1",
    "react-native-screens": "^3.3.0",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^12.1.1",
    "react-native-web": "~0.13.12",
    "react-swing": "^3.0.0",
    "realm": "^10.12.0",
    "watchman": "^1.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0"
  },
  "private": true
}

How do you do that?

How do you do what, exactly?

Switch to HTTPS when using the tool

I’m talking about using https for the dependency instead of ssh.

See node.js - How to install package from github repo in Yarn - Stack Overflow

So try something like this:

git+https://github.com/owner/package.git#commithashortagorbranch

But there’s also this problem:

You seem to have both yarn.lock and package-lock.json. If you use yarn to manage your dependencies you should delete package-lock.json. If you use npm, then delete yarn.lock.

After that you should delete your node_modules and reinstall your dependencies.