Push rejected, failed to compile Node.js app heroku

前端 未结 8 1020
面向向阳花
面向向阳花 2020-12-09 18:01

When I tried to push my nodejs app to heroku with git push heroku master, i got this:

Counting objects: 975, done.
Delta compression using up to         


        
相关标签:
8条回答
  • 2020-12-09 18:34

    I solved this.
    I got the same error:

    "Push rejected, failed to compile Node.js app"

    but my log was complaining about this Unknown option:

    '--target'
    

    I solved this digging out on my package.json and I found this line of code below:

    "postinstall": "ng build --aot --target=production"
    

    I removed the --target=production.

    On my terminal:
    I commited again $ git commit -m 'anything here'
    then $ git push heroku master
    And done.

    0 讨论(0)
  • The easiest way to make this work is to add node_modules to your .gitignore. Lots more info here: Fail to deploy node.js application to heroku

    0 讨论(0)
提交回复
热议问题