"Host key verification failed." for github npm package, lockfileVersion@2

This seems specifically related to the package-lock.json lockfileVersion. Downgrading to lockfileVersion@1 resolved this, but hoping it can be fixed on the eas build server:

  • Our build at commit 4902e47 failed with the below error
  • Our build at commit 14f9b3b succeeded - the only change in between was the lockfileVersion

eas build logs:

Running npm in the root dir of your repository 
[stderr] npm
[stderr] WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
[stderr] npm ERR! Error while executing:
[stderr] npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/[redacted].git
[stderr] npm ERR! 
[stderr] npm ERR! Host key verification failed.
[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.
[stderr] npm ERR! 
[stderr] npm ERR! exited with error code: 128
[stderr] 
[stderr] npm ERR! A complete log of this run can be found in:
[stderr] npm ERR!     /root/.npm/_logs/2021-12-02T06_34_58_696Z-debug.log
npm exited with non-zero code: 1

Note: The GH repo is public, so that’s not the issue, just redacting for privacy.

Thanks!

you can upgrade version of node (and npm) via node field in eas.json to version that supports new lockfiles

1 Like

That fixed it, thank you wkozyra!