I am trying to push local files to heroku and getting below error. I have my code in github
Can someone help me in this. Thanks
$ heroku buildpacks:set
git init and then readding heroku remote worked
heroku git:remote -a yourappname
Try: git add -f package.json It worked for me.
I see a few issues here
1) You need a procfile - https://devcenter.heroku.com/articles/getting-started-with-nodejs#define-a-procfile
2) You don't specify the engines in your package.json
"engines": {
"node": "0.10.x"
},
See here- https://discussion.heroku.com/t/the-official-node-js-buildpack-is-going-on-a-diet/100
3) You have comitted your node_modules
directory to git. You should be able to download packages using npm install
(that's what your packages.json
file is for)
Delete this directory, and commit the delete to git.
Then, create a .gitignore
file. Add the following line to your .gitignore
file:
node_modules
commit this .gitignore file to your repository.
Git will now ignore your node_modules_
directory