heroku deploy failed using nodejs

后端 未结 3 1241
无人共我
无人共我 2021-02-10 19:08

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          


        
3条回答
  •  一个人的身影
    2021-02-10 20:07

    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

提交回复
热议问题