When I push my node app to heroku master I get this log
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://codon-
buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
remote: Node.js: package.json not found in application root
I can't find the reason why this would happen as I clearly have in my root directory. I checked using git ls-files and it appears.
Is it possible that my application root is not the same as my repository root? How would one config that?
By default, Heroku runs npm start while starting deployed Node.
Run the npm install command in your local app directory to install the dependencies that you declared in your package. json file. Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.
js release schedule below, Heroku's currently supported Node. js versions are 14. x , 16. x , and 18.
One common issue is not having added the files to git.
You might be having package.json in your root directory on you device, without adding it to git, heroku can't find it.
Please check status to confirm and add if not added already
git status
git add .
then followed by the usual
git push heroku master
assuming you are on the master branch.
Hope this helps.
It seems that when I push to heroku master, heroku pushes the main branch of my local repository to heroku instead of the branch I'm currently in. So what I had to do was pushing with:
git push heroku mybranchname:master
so that my branch (not the master) gets pushed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With