'Couldn't find that formation' heroku deployment error

左心房为你撑大大i 提交于 2020-01-05 14:03:17

问题


I am trying to deploy a MEAN stack (MongoDB-Express-Angularjs-Nodejs) app on Heroku. After I push my code with git push heroku I get the following error "Scaling dynos... failed! Couldn't find that formation".

I have checked for a solution with no luck. I created a Procfile, but that didn't help. I still get the same error.

Any ideas on how I could get this up and running. I would include more code but I don't know where the problem is so please ask and I will include that code that is necessary.


回答1:


Okay so I found what was my problem. When I saw the error logs it was painfully obvious that I was having a MongoDB connection error. I had to point to the correct MongoDB instance and that worked like a charm. Posted below are the specific commands I used to correct the issue after I modified the "server.js" file.

What finally worked to allow me to deploy on Heroku!

> (reverse order)
>     $ heroku open
>     $ git push heroku master
>     $ git commit -m "myMessage"
>     $ git add <file>
>     $ git status

Commit message: I updated the mongoDB connection then committed and pushed the changes to Heroku now the app loads online.



来源:https://stackoverflow.com/questions/32513295/couldnt-find-that-formation-heroku-deployment-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!