Heroku CLI login is failing with error "Error: ENOENT: no such file or directory, open 'H:/_netrc'"

5.1k Views Asked by At

I have installed Heroku CLI on Windows,

Facing below failure while logging in:

Error: ENOENT: no such file or directory, open 'H:/_netrc'
heroku/7.41.1 win32-x64 node-v12.16.2

C:\Windows\system32>heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/2785a37e-18ec-43f0-a686-89cc597d2443
Logging in... done
Error: ENOENT: no such file or directory, open 'H:/_netrc'

C:\Windows\system32>```

Please help me with this.
Thanks,
Sagar                                                                                                                                   
2

There are 2 best solutions below

0
On

for windows follow the steps

  • cmd>set HomeDrive=c:/users/xxx
  • run heroku login again
  • when finished it will create _netrc in directory c:/users/xxx
0
On

Try running it from GIT BASH cmd, I had the same problem and it worked in my case.