【问题标题】:AWS Beanstalk Install Private Github Module via NPM Results In Authentication IssueAWS Beanstalk 通过 NPM 安装私有 Github 模块导致身份验证问题
【发布时间】:2015-08-22 11:40:59
【问题描述】:

我需要通过 npm 在 AWS Beanstalk 实例上安装一个私有 github 模块。

我正在使用 Github 个人访问令牌通过 github 进行身份验证并访问 repo。

我的package.json 列出了这样的依赖项:

"privatepackage": "git+https://jaf91ja9jasflkjasf98109asf10asdf:x-oauth-basic@github.com/user123/privatepackage.git"

但是,在 Beanstalk 上部署时出现以下错误:

npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code 128
npm ERR! Command failed: git clone --template=/tmp/.npm/_git-remotes/_templates --mirror git@github.com...
npm ERR! Cloning into bare repository '/tmp/.npm/_git-remotes/git-github-com...
npm ERR! Host key verification failed.
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.

【问题讨论】:

  • 你有没有找到解决这个问题的好方法?我发现了类似的问题和解决方案(例如以下链接中的问题和解决方案),但想知道您是否找到了更好的解决方案。 stackoverflow.com/questions/24993092/…

标签: node.js amazon-web-services github npm amazon-elastic-beanstalk


【解决方案1】:

我认为您的机器上缺少 ssh 密钥并在 github 上添加相同的密钥。

请查看generating-ssh-keys,这可能会帮助您解决此问题。

【讨论】:

  • 但是,我不需要 ssh,因为我使用的是个人访问令牌。
  • 好的,你有访问那个 repo 的权限吗?请确认。
  • 是的,具有适当范围的完全访问权限。
猜你喜欢
  • 2015-08-23
  • 2021-04-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-25
  • 2020-04-05
  • 1970-01-01
  • 2020-03-14
相关资源
最近更新 更多