Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Heroku部署错误-![远程拒绝]主机->;主控(预接收)_Node.js_Heroku - Fatal编程技术网

Node.js Heroku部署错误-![远程拒绝]主机->;主控(预接收)

Node.js Heroku部署错误-![远程拒绝]主机->;主控(预接收),node.js,heroku,Node.js,Heroku,我看到很多人都犯了这个错误,到目前为止,我已经尝试了我所看到的所有解决方案。检查Heroku是否知道它是什么类型的应用程序,从我的客户端文件夹中删除.git文件等等。在错误消息中,我可以看到它在查找文件时遇到了问题,但我不知道如何解决这个问题,因为我使用了git add-A和git add。无数次。我是一个开始,我不确定我错过了什么 这是执行git push heroku master时的错误消息: Counting objects: 100% (13/13), done. Delta

我看到很多人都犯了这个错误,到目前为止,我已经尝试了我所看到的所有解决方案。检查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'
正如在本文中所发现的,git回购协议仍然认为
客户机
是一个子模块,这是一个错误。修复方法是从git tracking中删除
客户端
文件夹,并将其添加回常规文件:

git rm-f——缓存客户端和git添加git commit-m“将客户端文件夹添加回git repo”和&git push heroku master

正如本文中所发现的,git repo仍然认为客户端是子模块,这是一个错误。修复方法是从git tracking中删除
客户端
文件夹,并将其添加回常规文件:


git rm-f——缓存客户端和git添加git commit-m“将客户端文件夹添加回git repo”和&git push heroku master

这对我来说是有效的(分支基于“origin/master”,但上游可能已经消失)。 (使用“git分支-取消设置上游”进行修复)


这对我来说是有效的(分支基于“源/主”,但上游可能已经消失)。 (使用“git分支-取消设置上游”进行修复)


试试这个命令:
git rm-f--cached client&&git add.&git commit-m‘将客户端文件夹添加回git repo’&git push heroku master
谢谢!!我想我之前试过这个,但我想我当时有一个不同的错误。这解决了问题。请尝试以下命令:
git rm-f--cached client&&git add.&&git commit-m‘将客户端文件夹添加回git repo’&git push heroku master
谢谢!!我想我之前试过这个,但我想我当时有一个不同的错误。这就解决了问题。
git branch --unset-upstream