cli: heroku login does not work with cygwin or git bash
This is now fixed. Just update your CLI.
Just run the following
$ heroku update
$ heroku login
OR
$ winpty heroku login -i
Or use cmd.exe instead
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 80
- Comments: 60 (7 by maintainers)
Commits related to this issue
- Add installation of heroku on windows. For windows, on git bash, `heroku login` don't work, hence use `winpty heroku login`. Refer https://github.com/heroku/cli/issues/84. — committed to rupav/badgeyay by rupav 6 years ago
- Add installation of heroku on windows. (#531) For windows, on git bash, `heroku login` don't work, hence use `winpty heroku login`. Refer https://github.com/heroku/cli/issues/84. — committed to fossasia/badgeyay by rupav 6 years ago
- Add installation steps of heroku on windows. For windows, on git bash, heroku login don't work, hence use winpty heroku login. Refer heroku/cli#84. Similar PR raised in badgeyay https://github.com/fo... — committed to rupav/query-server by rupav 6 years ago
- Add installation steps of heroku on windows. (#481) For windows, on git bash, heroku login don't work, hence use winpty heroku login. Refer heroku/cli#84. Similar PR raised in badgeyay https://github... — committed to fossasia/query-server by rupav 6 years ago
- Add installation of heroku on windows. (#531) For windows, on git bash, `heroku login` don't work, hence use `winpty heroku login`. Refer https://github.com/heroku/cli/issues/84. — committed to sagar-kalra/badgeyay by rupav 6 years ago
- Examples and h4 (#84) * add overview to topic * fix failing test * remove newline — committed to heroku/cli by KarateCowboy 7 years ago
- Use app from config name when foo::bar (#84) — committed to heroku/cli by deleted user 7 years ago
This message was a little unclear for me, so in case anyone is in a similar situation (after I activate 2FA, I received this error), here is what worked for me. I closed out Git Bash then opened the command prompt. From there, I was able to successfully login to heroku through “heroku login”. I then closed the command prompt and re-launched Git Bash and everything worked fine.
In regards to @starrychloe issue, running cmd within Bash/Cygwin probably won’t work either. You may need to close Cygwin and open a fresh command prompt and then login from there.
In installing, please chose “Use Windows default console window” fix error
Since my windows user home folder and my cygwin home folder are different, what I did was to
heroku loginusingcmd.exeand then copyingC:/Users/MyUser/_netrcto my cygwin homeLogin is currently incompatible with git bash/cygwin Log in with Windows cmd.exe, it will work:
if you run
winpty heroku loginit will work. We’re in the process of making this automaticIf you are running windows
This is inconsistent. I installed Heroku into Cygwin using the standalone installer (https://toolbelt.heroku.com/install.sh) which worked fine (once I removed all the
sudocommands in the install script). Some commands such asheroku appsandheroku logswork fine in the Cygwin shell (and ask for login) whereas directly callingheroku loginor commands likeheroku stack:setcome up with the message thatpointing to this issue.
Because I installed the toolbelt using Cygwin, to run it using
cmdI have to runIt would be nice if this would get fixed, but in the mean time, the best way to launch a cmd prompt from a different (cygwin/git bash/etc.) shell is to run
for git-bash I prefer alias for herok cmd like this one:
alias heroku='winpty /c/tools/heroku/bin/heroku.cmd'(my path for heroku.cmd is C:\tools\heroku\bin\heroku.cmd) stored in%HOMEDRIVE%%HOMEPATH%\.bashrcand them I can simple using heroku cmd in git-bash likeheroku login/heroku auth:loginwithout any additional tricks.I am using Windows 10 and installed the 64 bit Windows install and was able to login with @eappleby solution (cmd.exe) and like @weidmaster (& many others) I want to use git bash.
I uninstalled the 64 bit Windows install and used Chocolately to install Heroku-cli and it works with git bash.
@rbashish It appears that you did not enter your email or password correctly. I have been able to login successfully via cmd.exe. Could you please try again?
Use CMD in windows
@eappleby suggestion is the preferred solution right now, run
heroku loginusing the windows command prompt. This will drop your API key into your netrc, at which point you can open up cygwin or git bash and do whatever you need to. The root cause of this problem is that stdin is not a real terminal, so we cannot turn off the echo during the password request. One solution we have considered is popping up a dialog to get the username password as this is what git does within git bash, but I am not sure how soon I will be able to get to this.use cmd.exe to login then
@SPurno Faruk Ahmed, this thread is about git/cygwin.
Simple fix. Install Heroku on Windows machine as per the site instructions. Then, with Git Bash closed open the windows “Command Prompt” and type “heroku login”. You will be prompted for your Heroku username and password and you’re in! Close the command prompt and use bash as per normal.
For me logging through cmd.exe didn’t save the credentials, so my cygwin/babun on Win7 x64 would ask for them again after heroku create.
But helped what @npalmius said:
EDIT: but later when doing
git push heroku masterI got:I did two things simulatneously and don’t know which fixed it:
heroku loginin cmd.exe pointed atE:\Tools\babun\cygwin\usr\local\lib\heroku\bin\Also, checked that both _netrc files in
C:\Users\MyNameandE:\Tools\babun\cygwin\home\MyNamehave the same value, and that include entries for machine git.heroku.com and machine api.heroku.comswitching to ms cmd shell by typing cmd in cygwin terminal, and then back to bash sh by typing sh
Got this error when using Mobaxterm:-
When can I expect the fix?
I got this when I tried to login…
@CMCDragonkai, nice one 😃
Even better, just run
cygstart zshfrom the bash shell, then runheroku login, then close the zsh shell and bash works just fine.What I really don’t understand about this issue though is that other programs like ssh work fine hiding the password.
Sorry, I dont get it, what the solution here?