I ma trying to add a react-flask-redis app to Heroku. How can I find the source of the issue. The structure of files are as follows:
root >
> frontend\
> backend\
> Procfile
However, it gives this error:
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: Verifying deploy...
remote:
remote: ! Push rejected to new-app-9876.
remote:
To https://git.heroku.com/new-app-9876.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/new-app-9876.git'
I'm trying to deploy a React Web app on Heroku using the Heroku CLI. However when I run,
git push heroku master
from my project folder it throws an error as:
Counting objects: 213, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (212/212), done.
Writing objects: 100% (213/213), 515.89 KiB | 0 bytes/s, done.
Total 213 (delta 40), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Build failed
remote: ! Two different lockfiles found: package-lock.json and
yarn.lock
remote:
remote: Both npm and yarn have created lockfiles for this
application,
remote: but only one can be used to install dependencies.
Installing
remote: dependencies using the wrong package manager can
result in missing
remote: packages or subtle bugs in production.
remote:
remote: - To use npm to install your application's
dependencies please delete
remote: the yarn.lock file.
remote:
remote: $ git rm yarn.lock
remote:
remote: - To use yarn to install your application's
dependences please delete
remote: the package-lock.json file.
remote:
remote: $ git rm package-lock.json
remote:
remote: https://kb.heroku.com/why-is-my-node-js-build-
failing-because-of-conflicting-lock-files
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to MyAPP.
remote:
To https://git.heroku.com/MyAPP.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
https://git.heroku.com/MyAPP.git'
I did rm and removed the yarn lock file since I use npm. Still the same error shows up. Now when I actually do rm yarn.lock I get a no entry found in the terminal. Idk why Heroku CLI insists that I still have yarn lock file in the directory.
If you use npm:
git rm yarn.lock
git commit -m "Remove yarn lock file"
git push heroku master
If you use yarn:
git rm package-lock.json
git commit -m "Remove npm lock file"
git push heroku master
Are you committing back to your master branch before pushing it up to Heroku?
Most often for me, problems like this arise when I make a code change and then 'git push heroku master' but my master branch has not been updated as I haven't yet committed my local changes.
Try
git commit -m 'some changes'
then
git push heroku master
delete both yarn.lock and package-lock.json and after it:
git add --all
git commit -a -m "Delete yarn lock and package lock"
git push
git push heroku master
that works for me!
I had the same problem, but the above suggestions didn't help. What I did was to delete yarn.lock (git rm yarn.lock) and the error was gone.
I had the same issue, but in my case I was pushing the master branch which contained both package-lock.json and yarn.lock. I fixed this by using the command git push heroku branch-name:master.
If you use npm please follow this :
rm yarn.lock
git add .
git commit -m 'remove yarn.lock file'
git push origin
git push heroku origin
Had the same issue. Not sure how package-lock is being recreated upon deploying to heroku but thats what seems to be happening. Try creating a .npmrc file and adding package-lock=false This fixed the issue for me.
Also check if you need a buildpack for deploying to heroku.
For example for meteor you need to add a buildpack
heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
if you have multiple apps for that git make sure to add --app foobar as your app name to your heroku command
In my case, I had to checkout main branch and run
git push heroku main.
this solved my problem
this is my server folder: https://github.com/Yokubjon-J/react-chat-testSuite/tree/master/server. whenever i run "git push heroku master" i am getting the error below:
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'
I have browsed through several stackoverflow answers to no avail.
Any suggestions?
I set buildpacks, typed "web: node index.js" in procfile, but none of it helped
The error says "No default language could be detected for this app.
Try:
heroku buildpacks:set heroku/the-programming-language OR
heroku create myapp --buildpack heroku/the-programming-language
refer-https://devcenter.heroku.com/articles/buildpacks
I ran cd .. and then git subtree push --prefix server heroku master. this way the problem was solved. For reference: https://dev.to/stlnick/how-to-deploy-a-full-stack-mern-app-with-heroku-netlify-ncb
I could not deploy laravel project to Heroku
First when I wrote "Heroku open" it showed "Forbidden
You don't have permission to access / on this server." Then I added to scripts part of composer.json
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"chmod -R 775 public/"
]
Then it shows this ERROR
Error
remote: ! WARNING: A post-install-cmd script terminated with an error
remote:
remote: ! ERROR: Dependency installation failed!
remote: !
remote: ! The 'composer install' process failed with an error. The cause
remote: ! may be the download or installation of packages, or a pre- or
remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
remote: ! in your 'composer.json'.
remote: !
remote: ! Typical error cases are out-of-date or missing parts of code,
remote: ! timeouts when making external connections, or memory limits.
remote: !
remote: ! Check the above error output closely to determine the cause of
remote: ! the problem, ensure the code you're pushing is functioning
remote: ! properly, and that all local changes are committed correctly.
remote: !
remote: ! For more information on builds for PHP on Heroku, refer to
remote: ! https://devcenter.heroku.com/articles/php-support
remote: !
remote: ! REMINDER: the following warnings were emitted during the build;
remote: ! check the details above, as they may be related to this error:
remote: ! - A post-install-cmd script terminated with an error
remote:
remote: ! Push rejected, failed to compile PHP app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to frozen-harbor-81797.
remote:
To https://git.heroku.com/frozen-harbor-81797.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/frozen-harbor-81797.git'
I am using this "Heroku buildpack for Dart" from the following Github repository: https://github.com/igrigorik/heroku-buildpack-dartam .
I followed the set of commands to deploy the HTTP server built with Dart to Heroku and once I try to push the app to Heroku (git push heroku master) I receive the following error:
remote: End-of-central-directory signature not found. Either
remote: this file is not a zipfile, or it constitutes one disk of
remote: a multi-part archive. In the latter case the central
remote: directory and zipfile comment will be found on the last
remote: disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of dart-
remote: sdk.zip or dart-sdk.zip.zip, and cannot find dart-
remote: sdk.zip.ZIP, period.
remote: ! Push rejected, failed to compile Dart app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to testdartapp.
remote:
To https://git.heroku.com/testdartapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/testdartapp.git'
I am attaching a screenshot of my terminal output: Pushing app to Heroku
Any advice is much appreciated! Thanks in advance.