'Couldn't find that formation' heroku

2019-08-15 07:13发布

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条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-15 07:30

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.

查看更多
登录 后发表回答