这是我的服务器文件夹:https://github.com/Yokubjon-J/react-chat-testSuite/tree/master/server .每当我运行“git push heroku master”时,我会收到以下错误:
Total 866 (delta 199), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to my-first-react-chat-app.
remote:
To https://git.heroku.com/my-first-react-chat-app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/my-first-react-chat-app.git'
我已经浏览了几个stackoverflow的答案都没有用。有什么建议吗?我设置了buildpack,输入了“web:节点index.js”,但没有任何帮助
2条答案
按热度按时间wnvonmuf1#
该错误显示“无法检测到此应用程序的默认语言。
请尝试:
heroku构建包:设置heroku/编程语言OR
heroku创建我的应用程序--构建包heroku/编程语言
请参阅devcenter.heroku.com/articles/buildpacks
9gm1akwq2#
我运行了
cd ..
,然后运行了git subtree push --prefix server heroku master
。这样问题就解决了。供参考:https://dev.to/stlnick/how-to-deploy-a-full-stack-mern-app-with-heroku-netlify-ncb