Heroku CLI身份验证问题
在Windows 7上全新安装Heroku之后,我似乎无法从命令行进行身份验证.
After a fresh install of Heroku on Windows 7, I can't seem to authenticate from the command-line.
运行命令:heroku login
提示我输入凭据.这样做之后,我收到一个错误:
Running the command: heroku login
prompts me to enter my credentials. After doing so, I received an error:
heroku: Enter your login credentials
Email: my_email
Password: ************
Error: ENOENT: no such file or directory, open 'z:/_netrc'
我正在使用PowerShell,并且当我运行命令cat z:/_netrc
时,出现此错误:
I am using PowerShell, and when I run the command cat z:/_netrc
, I get this error:
cat : Cannot find drive. A drive with the name 'z' does not exist.
Z:
是网络驱动器,可从文件资源管理器访问.
Z:
is a network drive, and it is accessible from the file explorer.
我的%HOME%路径中已经有一个.netrc
文件,但是它不包含heroku登录凭据.
I already have a .netrc
file in my %HOME% path, but it does not contain the heroku login credentials.
查看官方文档和CLI帮助,找不到解决此问题的有用方法.如何登录到我的heroku帐户?
Looking at the official documentation and CLI help, I couldn't find anything useful to fix this. How can I login to my heroku account?
> heroku version
heroku/7.16.6 win32-x64 node-v10.11.0
因此,问题是由于无法在本地计算机上找到完成Heroku登录所需的_netrc
文件而引起的.我决定将文件创建到Windows 10计算机的以下位置:
So, the issue is arising from not finding _netrc
file on your local computer that is required to complete login with Heroku. I have decided to create the file into following location of my windows 10 computer:
cmd>set HomeDrive=C:/Users/your Windows username/AppData/Local/heroku
就我而言,
cmd>set HomeDrive=C:/Users/CrazyMoby/AppData/Local/heroku
最后我跑了heroku login
以上步骤解决了我的heroku登录问题.
The above step resolved heroku login issue in my case.