Đây là ảnh của lỗi:
Nghĩa là khi bạn dùng lệnh heroku login thì con trỏ cứ nhấp nháy hoài mà không hiển thị Email và Password cho bạn nhập. Và bạn không thể thực hiện heroku apps, heroku app:destroy,…..
Nguyên nhân lỗi là do file thông tin đăng nhập gặp vấn đề gì đó. Bạn chỉ cần xóa (lệnh mv trong linux) là xong.
Nên cập nhật heroku heroku update
trước khi thực hiện sửa lỗi.
mv ~/.netrc ~/.netrc.backup
heroku login
Trên Window, các bạn tìm file _netrc.
(tìm thư mục cấu hình hoặc dùng tính năng search trên window) và xóa nó đi.
Sau khi xóa file đó là heroku login bình thường:
Một vài lưu ý nhỏ:
Sau khi login và thực hiện xong công việc, các bạn nên sử dụng lệnh heroku logout
để đăng xuất khỏi phiên làm việc, như vậy sẽ ít xảy ra lỗi hơn.
Tham khảo thêm tại: https://devcenter.heroku.com/articles/heroku-cli#homebrew-specific-issues
Nguyên văn:
Troubleshooting
If you’re having issues with the CLI, first ensure that you’re using the latest version. If you’re not, try updating with
heroku update
.Not all methods of installation support
heroku update
.
- If you installed the CLI with
apt
, you need to usesudo apt-get update && sudo apt-get upgrade heroku
instead.- If you installed the CLI with
npm
oryarn
, you need to usenpm upgrade -g heroku-cli
oryarn global upgrade heroku-cli
instead.If the CLI fails to update, try uninstalling it with the instructions below, then reinstalling it. Ensure that you don’t have the legacy Heroku Toolbelt or Heroku Ruby gem installed by using
which heroku
orwhere heroku
(on Windows) to confirm what theheroku
command points to. You might need to modify yourPATH
to include/usr/local/bin/heroku
(for most installations).If you’re still encountering an issue, you can set the following debugging environment variables to help diagnose it:
Environment Variable Description HEROKU_DEBUG=1
Shows debugging information mostly related to Heroku API interactions HEROKU_DEBUG=2
Same as above but adds HTTP headers (only for “v6” commands) HEROKU_DEBUG_HEADERS=1
Alongside HEROKU_DEBUG=1
, shows HTTP headersDEBUG=*
Shows very verbose debugging information You can also check the CLI’s error logfile, which is stored at one of the following locations depending on your operating system:
OS Location MacOS ~/Library/Caches/heroku/error.log
Windows %LOCALAPPDATA%\heroku\error.log
Linux/Other ~/.cache/heroku/error.log
(orXDG_CACHE_HOME
if set)If you continue to have problems and the CLI is up to date, or if updating fails for other reasons, you can reset the CLI by deleting its user directories. These directories are replaced automatically and you will not be logged out, but you will lose any installed plugins.
First, run
heroku plugins
to list your installed plugins so you can make sure to reinstall them.Then, delete the following directories:
Windows:
%LOCALAPPDATA%\heroku
MacOS/Linux/Other:
~/.local/share/heroku
(orXDG_DATA_HOME
if set)- Either
~/Library/Caches/heroku
on MacOS, or~/.cache/heroku
on Linux/Other (orXDG_CACHE_HOME
if set)~/.config/heroku
(orXDG_CONFIG_HOME
if set)Login issues
If you are experiencing issues with logging in, try moving your
.netrc
file. This is where the CLI stores credentials:mv ~/.netrc ~/.netrc.backup
heroku login
On Windows, the file is named
_netrc
.