安装 node_modules 时构建失败并显示“主机密钥验证失败”

ygy*_*zyx 5 heroku node.js

更新 清除我的构建缓存并在没有package-lock.json修复的情况下进行部署。

将我的 Node 应用程序部署到 HerokuHost key verification failed在安装我的一个依赖项(公共存储库)时开始失败:

-----> Monorepo app detected
      Copied /server to root of app successfully
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=DEVELOPMENT
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  10.x
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 10.x...
       Downloading and installing node 10.22.1...
       Using default npm version: 6.14.6
       
-----> Restoring cache
       - node_modules
       
-----> Installing dependencies
       Installing node modules
       npm ERR! Error while executing:
       npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/ethereumjs/ethereumjs-abi.git
       npm ERR! 
       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.
       npm ERR! 
       npm ERR! exited with error code: 128
       
       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.RchR7/_logs/2020-10-25T17_11_28_328Z-debug.log
-----> Build failed
Run Code Online (Sandbox Code Playgroud)

我的 buildpacks 没有任何变化,以前可以使用:

1. https://github.com/lstoll/heroku-buildpack-monorepo
2. https://github.com/heroku/heroku-buildpack-nodejs
Run Code Online (Sandbox Code Playgroud)
  • 应用程序已经在 Heroku 上运行了数周,使用的ethereumjs-abi是依赖项的包。(它不是我的应用程序的直接依赖项。)
  • ethereumjs-abi 自从我开始使用它就没有更新
  • 应用程序在本地仍能正常运行
  • 我自己的回购是私有的,但包回购是公开的。
  • 我最近更改了我的 SSH 密钥,但自从将它们添加到 GitHub 以来,没有任何其他 SSH 问题。我现在已经将新密钥添加到 Heroku 中heroku keys:add,但它没有效果。
  • 以前我是指定的engines: { node: 10.x },但现在也尝试了 12.x 和 14.x
  • 从本地推master送到 Herokumaster

kas*_*ndr 3

是的,浪费了几天时间...

当用我自己的 fork 替换 npm 包并在 github.com 上提供自定义链接时,遇到了同样的问题。

有什么帮助:

  1. 从 GIT 中删除包锁
  2. 清除缓存heroku builds:cache:purge --app $HEROKU_APP_NAME --confirm $HEROKU_APP_NAME

  • 在使用 heroku 构建之前,我们还需要安装该插件。heroku 插件:安装 heroku-builds (3认同)