git push to heroku asking for login but giving me error

Viewed 936

On the command line, I run Heroku login and it brings me to my browser to login, which I do and the web page says I did successfully. But then my command line says:

Opening browser to https://cli-auth.heroku.com/auth/browser/9547a839-ddb8-4b50-a585-7f48c2d81c8a
Logging in... done
Error: EPERM: operation not permitted, open 'C:/Users/my-name/_netrc'

I open that file which contains a user name and password, it has one for "machine api.heroku.com" and one for "machine git.heroku.com". So I try to use "git push heroku master" and then I'm prompted for a user name and password, but neither of those work. I get:

remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry the git command.
2 Answers

This is a bit late, probably would help someone in the near future, another solution that worked is to delete the '_netrc' file in 'C:/Users/my-name/_netrc', heroku needed to create a new '_netrc' file especially after upgrading, the file seemed to clash with the new heroku upgrade.

Only works if command prompt is run as administrator. Note: This solution is for windows operating system

Related