【问题标题】:npm install -g aws-amplify/cli gives The authenticity of host 'github.com (192.30.255.112)' can't be establishednpm install -g aws-amplify/cli 给出无法建立主机'github.com(192.30.255.112)'的真实性
【发布时间】:2021-06-18 00:08:12
【问题描述】:

在尝试运行 sudo npm install -g aws-amplify/cli 时, 我收到错误The authenticity of host 'github.com (192.30.255.112)' can't be established

阅读The authenticity of host 'github.com (192.30.252.128)' can't be established 后,我运行了 ssh -T git@github.com 并获得了 Permission denied (publickey)。错误。 现在,如果我再次运行 aws-amplify 安装,我会得到:

npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://git@github.com/aws-amplify/cli.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthewmathias/.npm/_logs/2021-03-20T23_41_46_515Z-debug.log

帮助?

M

【问题讨论】:

    标签: github ssh aws-amplify


    【解决方案1】:

    至少从完成您的 known_hosts 开始:

    ssh-keyscan -Ht rsa github.com,192.30.255.112 ~/.ssh/known_hosts
    

    (虽然你可能想double-check the fingerprint with nmap first

    其次,尝试ssh -Tv git@github.com 看看考虑了哪些键。
    确保拥有例如~/.ssh/id_rsa.pub registered to your account


    或者,强制 npm 使用 HTTPS URL:

     git config --global url."https://github.com/".insteadOf git@github.com:
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-22
      • 2013-09-13
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      • 2020-01-05
      • 2016-02-11
      • 2021-04-19
      相关资源
      最近更新 更多