I am new to heroku and express.js. I try to go through the tutorial, but I cannot make it with the step \'git push heroku master\'. I followed the tutorial exactly. Below is the
You need a package.json file (and a Procfile), it is likely not the case.
Just for the record, I had the same problem and it turned out to be one of the Config Vars in Heroku. I remove the config vars and the app was pushed successfully.
did you read the Getting Started with Node.js on Heroku article on Heroku Dev Center?
You need to declare your process type with Procfile. To do so, create a file named Procfile
, with the following content:
web: node web.js
assume that your javascript file is called web.js
.
p.s. don't forget to add the Procfile to git and commit it.
For me, doing npm init
was enough
I have encountered this issue a few time before and it was because I was trying to push a remote branch to heroku.
To solve the problem, instead of using:
git push heroku master
I used:
git push heroku my-branch:master
This pushes the remote branch my-branch
in the git repository to the master
branch of heroku.