Heroku部署错误-! [远程拒绝]主机->主机(预接收挂钩被拒绝)

时间:2020-08-28 19:12:08

标签: node.js heroku

我已经看到很多人遇到此错误,并且到目前为止,我已经尝试了所见过的所有解决方案。检查Heroku是否知道它是哪种应用,请从我的客户端文件夹中删除.git文件,依此类推。在错误消息中,我可以看到它在查找文件时遇到了麻烦,但是我不知道如何像git add -A和git add那样解决此问题。很多时间。我只是一个开始,我不确定自己缺少什么。

这是我执行git push heroku master时的错误消息:

    Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (13/13), 13.79 KiB | 1009.00 KiB/s, done.
Total 13 (delta 0), reused 0 (delta 0), pack-reused 0        
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.18.3...    
remote:        Using default npm version: 6.14.6
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules
remote:        added 131 packages in 5.646s
remote:        
remote: -----> Build
remote:        Running heroku-postbuild
remote:        
remote:        > mern_project@1.0.0 heroku-postbuild /tmp/build_07c4cff9
remote:        > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
remote:
remote:        up to date in 0.242s
remote:        found 0 vulnerabilities
remote:
remote: npm ERR! code ENOENT
remote: npm ERR! syscall open
remote: npm ERR! path /tmp/build_07c4cff9/client/package.json
remote: npm ERR! errno -2
remote: npm ERR! enoent ENOENT: no such file or directory, open '/tmp/build_07c4cff9/client/package.json'
remote: npm ERR! enoent This is related to npm not being able to find a file.
remote: npm ERR! enoent
remote:
remote: npm ERR! A complete log of this run can be found in: 
remote: npm ERR!     /tmp/npmcache.LOFwn/_logs/2020-08-28T19_01_14_938Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 254
remote: npm ERR! mern_project@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run 
build --prefix client`
remote: npm ERR! Exit status 254
remote: npm ERR!
remote: npm ERR! Failed at the mern_project@1.0.0 heroku-postbuild 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.LOFwn/_logs/2020-08-28T19_01_14_958Z-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:
remote:  !     Push rejected, failed to compile Node.js app. 
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to floating-island-87176.      
remote:
To https://git.heroku.com/floating-island-87176.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/floating-island-87176.git'

2 个答案:

答案 0 :(得分:0)

在此github issue中发现,这是一个错误,因为git repo仍然认为let s = `34 bananas, 12 l. applejuice., Zusätzlich benötigte Fahrzeuge: 43 FuStW, 93 Löschfahrzeuge (LF), 86.375 l. Wasser, 300 l. Löschschaum, 25 Drehleitern (DLK 23), 2 FwK, 2 GW-A oder AB-Atemschutz, 10 Gerätekraftwagen (GKW), 10 THW-Einsatzleitung (MTW TZ), 1 Schlauchwagen (GW-L2 Wasser, SW 1000, SW 2000 oder Ähnliches), 10 ELW 1, 2 Dekon-P, 25 ELW 2, 1 GW-Messtechnik, 1 GW-Gefahrgut, 1 GW-Höhenrettung, 1 Rettungshundestaffel/n. Wir benötigen mindestens 12 Feuerwehrleute.`; let pattern = /(?<k>[\d.]+)\s(?<i>[\p{L}\d_\s\/.-]+(?<!\.)(?:\([^()]*\))?)/gu console.log(s.match(pattern));是一个子模块。解决方法是从git跟踪中删除client文件夹,并将其重新添加为常规文件:

client

答案 1 :(得分:0)

这对我有用(分支基于'origin/master',但上游可能消失了。 (使用“git branch --unset-upstream”来修复)

git branch --unset-upstream