git, Heroku: pre-receive hook declined

后端 未结 15 2881
时光取名叫无心
时光取名叫无心 2020-12-09 02:33

I am in the process of setting up a git repository and attempting to link it to Heroku. When I run the command

git push heroku master

I rec

15条回答
  •  盖世英雄少女心
    2020-12-09 02:44

    Came across this same error when deploying a node app, but resolved with these two steps and thought I'd share in case anyone else runs into the same issues.

    1. Make sure you aren't committing node_modules since heroku installs dependencies from package.json on push. Try adding node_modules/ to your .gitignore to ensure you don't accidentally commit it
    2. Heroku uses Node v12 which node-sass 4.10.0 will fail to build with. Try increasing node-sass version by adding the following. This allowed it to build successfully for me:
      "devDependencies": {
        "node-sass": "^4.12.0"
      }
    

提交回复
热议问题