Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Deploy - "Push rejected, failed to compile Node.js app"

Trying to deploy a Node.js application to heroku but when using git push heroku master I get the following trace (only part of the whole trace is shown but it is the part which I believe to be the problem - if not let me know):

remote: -----> Build failed
remote:
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote:        Some possible problems:
remote:
remote:        - Dangerous semver range (>) in engines.node
remote:        https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote:        Love,
remote:        Heroku
remote:
remote:
remote:  !     Push rejected, failed to compile Node.js app

The package.json file works fine with other people's heroku, so that doesn't seem to be the problem.

Any ideas let me know.

Thanks

like image 285
user3352349 Avatar asked Oct 12 '15 18:10

user3352349


2 Answers

The issue is caused because you are trying to push with node version greater or less than what you installed. Do node -v

then replace the value of your installed node version with the one in your package.json.

https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

like image 144
sannimichaelse Avatar answered Oct 10 '22 03:10

sannimichaelse


redo a

git add .
git commit -a -m'comment' 
git push 

plz ref

heroku push rejected failed to compile node.js app

Push rejected, failed to compile Node.js app heroku

like image 36
Aishwat Singh Avatar answered Oct 10 '22 04:10

Aishwat Singh