将我的应用程序部署到 HEROKU 出现错误([远程拒绝] main -> main(预接收钩子被拒绝)

在使用命令行 heroku create 创建我的应用程序之后。 我试图将我的本地文件推送到 heroku 平台。 但它给出了错误。 ! [remote rejected] main -> main (pre-receive hook declined) 请提供任何帮助。

这是在命令行上将应用程序推送到 heroku 后的结果。

Enumerating objects: 1932,done.
Counting objects: 100% (1932/1932),done.
Delta compression using up to 8 threads
Compressing objects: 100% (1817/1817),done.
Writing objects: 100% (1932/1932),28.51 MiB | 1.04 MiB/s,done.
Total 1932 (delta 331),reused 0 (delta 0),pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  unspecified
remote:        engines.npm (package.json):   unspecified (use default)
remote:        
remote:        Resolving node version 14.x...
remote:        Downloading and installing node 14.17.4...
remote:        Using default npm version: 6.14.14
remote:        
remote: -----> Installing dependencies
remote:        Prebuild detected (node_modules already exists)
remote:        Rebuilding any native modules
remote:        
remote:        > node@16.5.0 preinstall /tmp/build_394ee399/node_modules/node
remote:        > node installArchSpecificPackage
remote:        
remote:        /tmp/build_394ee399/node_modules/node/node_modules/.bin/node: 1: Syntax error: "(" unexpected
remote:        internal/modules/cjs/loader.js:892
remote:          throw err;
remote:          ^
remote:        
remote:        Error: Cannot find module 'node-linux-x64/package.json'
remote:        Require stack:
remote:        - /tmp/build_394ee399/node_modules/node/installArchSpecificPackage.js
remote:            at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
remote:            at Function.resolve (internal/modules/cjs/helpers.js:98:19)
remote:            at ChildProcess.<anonymous> (/tmp/build_394ee399/node_modules/node-bin-setup/index.js:18:27)
remote:            at ChildProcess.emit (events.js:400:28)
remote:            at maybeclose (internal/child_process.js:1055:16)
remote:            at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
remote:          code: 'MODULE_NOT_FOUND',remote:          requireStack: [
remote:            '/tmp/build_394ee399/node_modules/node/installArchSpecificPackage.js'
remote:          ]
remote:        }
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno 1
remote:        npm ERR! node@16.5.0 preinstall: `node installArchSpecificPackage`
remote:        npm ERR! Exit status 1
remote:        npm ERR! 
remote:        npm ERR! Failed at the node@16.5.0 preinstall script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:        
remote:        npm ERR! A complete log of this run can be found in:
remote:        npm ERR!     /tmp/npmcache.cXErX/_logs/2021-07-31T12_22_25_755Z-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_modules checked into source control
remote:          https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
remote:        
remote:        - Node version not specified in package.json
remote:          https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:        
remote:        - A module may be missing from 'dependencies' in package.json
remote:          https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies
remote:        
remote:        Love,remote:        Heroku
remote:        
remote:  !     Push rejected,failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: d4f92420419812aa77130df4944b8abb7bb29f2f
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version d4f92420419812aa77130df4944b8abb7bb29f2f
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to infinite-tor-09444.
remote: 
To https://git.heroku.com/infinite-tor-09444.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/infinite-tor-09444.git'
  [Bookmarked Jul 31,2021 5:47:18 PM]

我尝试了 heroku 文档中给出的可能解决方案,但仍然没有给出结果。

aukle 回答:将我的应用程序部署到 HEROKU 出现错误([远程拒绝] main -> main(预接收钩子被拒绝)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/5317.html

大家都在问