【问题标题】:Error while executing /usr/bin ls-remote -h -t ssh://git@github.com/xxxx/xxxx.git while pushing to heroku推送到heroku时执行/usr/bin ls-remote -h -t ssh://git@github.com/xxxx/xxxx.git 时出错
【发布时间】:2023-10-30 08:04:01
【问题描述】:

我有一个 nodejs 应用程序。我正在尝试将其推送到 heroku 并在 heroku 中执行它。在通过 heroku CLI 部署时,我遇到了一个问题。请帮忙。谢谢。 我知道这可以在git config --global url."https://".insteadOf ssh:// 的帮助下在本地系统中解决,但是在部署到 Heroku 时如何解决?

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version 12.x...
remote:        Downloading and installing node 12.16.2...
remote:        Using default npm version: 6.14.4
remote:
remote: -----> Installing dependencies
remote:        Installing node modules (package.json + package-lock)
remote:        npm ERR! Error while executing:
remote:        npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/xxxx/xxx.git
remote:        npm ERR!
remote:        npm ERR! Host key verification failed.
remote:        npm ERR! fatal: Could not read from remote repository.
remote:        npm ERR!
remote:        npm ERR! Please make sure you have the correct access rights
remote:        npm ERR! and the repository exists.
remote:        npm ERR!
remote:        npm ERR! exited with error code: 128
remote:
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.FA1w0/_logs/2020-04-14T06_41_51_429Z-debug.log
remote:
remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:

【问题讨论】:

    标签: javascript node.js express heroku heroku-nodejs


    【解决方案1】:

    刚刚遇到了同样的问题。仍然不知道如何正确修复它。 但快速解决方法是手动将ssh://git@github.com/xxxx/xxx.git 替换为https://github.com/xxxx/xxx.git 文件中的package-lock.json

    【讨论】:

      【解决方案2】:

      基于 NPM 存储库中的 this comment 的另一种解决方法是配置 Git,使其强制使用 https 而不是 SSH:

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

      【讨论】:

        最近更新 更多