I am getting some kind of error when deploying my app to heroku using git hub. The problem is, I don\'t understand the heroku logs and the entailing errors. Here is the hero
I also faced similar kind of errors for my node js app while publishing it to heroku.com
First create a procfile, procfile is a simple text file but without any extension.
Place only one line in procfile as of now.
web: npm start
Now create the package.json file using command
npm init
once your package.json file got created please place the start property inside scripts.
"scripts": {
"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
now commit all (procfile/package.json) pending files. and deploy app again from heroku.
My silly mistake was that I was pushing the master branch to Heroku while my changes were in another branch!
Make sure that you merge your latest branch with your master branch first
> git checkout master
> git merge your-latest-branch
> git push heroku master
You have to inform heroku where to start : missing script: start
. In your package.json, you should have something like this:
"scripts": {
"start": "node index.js"
}
Where index.js
is your entry point.
As an alternative, you can specify in Procfile
:
web: node index.js
In my case, changing this:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
to this:
"scripts": {
"start": "node app.js"
},
was the solution