问题
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