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
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.
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