问题
I am new to Heroku and I keep getting the above error - everything looks good to go when I deploy in heroku, connect to my github repo etc.. but I keep getting this error.
Its a node/express app and works exactly as I'd like locally but it won't deploy. Any help would be appreciated.
回答1:
For getting logs of particular heroku app, use: heroku logs --app=app_name For example: your app name is 'chatapp'
heroku logs -app=chatapp
回答2:
just run the command with the --app flag, followed by the app name.
回答3:
To expand a little further on this (just for the benefit of other new users encountering a similar issue) - below is an example of a command you could enter in macOS Terminal:
heroku logs --tail --app yourexampleservername
If you have deployed yourexampleservername to Heroku, this should then display a log.
回答4:
I like how the --app flag is "mandatory" according to the official documentation, but the lone usage example in the official documentation doesn't use the --app flag.
Anyway, it's not really mandatory. It's just implicit, usually. You have to tell Heroku which app you're using, with something like heroku git:remote -a your_app_name, and then it stops wondering which app to run these commands on.
来源:https://stackoverflow.com/questions/54779162/error-missing-required-flag-a-app-app-app-to-run-command-against