git - 当我尝试将我的应用推送到 heroku 时出现(远程拒绝)错误
问题描述
我正在尝试将我的后端推送到 heroku 以获取我的全栈应用程序,但是当我在终端上输入“git push heroku master”时,我收到了这个错误
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ammans-sign-in-backend.git'
我关注的视频也出现了这个错误,但他通过从 package.json 中删除 yarn 解决了这个错误。但我没有安装纱线,所以我不知道是什么导致了这个错误。
完整错误供参考
PS C:\Users\Amman\dunder-mifflin\src\backend> git push heroku master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 841 bytes | 420.00 KiB/s, done.
Total 3 (delta 0), 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: ! 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: !
remote: ! ## Warning - The same version of this code has already been built: 3aa4f9300d4b24e64213357cadb3c360dbff848c
remote: !
remote: ! We have detected that you have triggered a build from source code with version 3aa4f9300d4b24e64213357cadb3c360dbff848c
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 ammans-sign-in-backend.
remote:
To https://git.heroku.com/ammans-sign-in-backend.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ammans-sign-in-backend.git'
解决方案
如果您查看错误,您会发现您尚未选择构建包。因此,只需访问网站并选择您正在使用的语言的 buildpack。
推荐阅读
- express - Nodejs如何将参数传递到另一个路由的导出路由中?
- spring - 如何从一个控制器类和 fxml 文件创建多个控制器和视图实例
- c - 释放具有函数指针的结构会导致 SIGTRAP
- php - 我怎样才能不断更新图像或文件,而仍然不删除或丢失其他文件?PHP 代码点火器
- android - Admob 广告中标题文本的可见性?
- c++ - 如何找到随机整数中每个数字的出现次数?
- pytorch - pytorch - 如何从 DistributedDataParallel 学习中保存和加载模型
- javascript - Angular Shopping Cart - 本地存储服务和订阅更改
- android - 在同一 wifi 上从 Android 访问我的 Mac 上的本地主机网络服务器
- azure-active-directory - Keycloak Azure AD - SAML 2.0 身份提供程序错误