Composer install / update 更新時出現 GitHub API limit (0 calls/hr) is exhausted, Could not fetch

1
2
3
4
5
GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/graphql. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+TED-Mac+2021-09-15+1126
to retrieve a token. It will be stored in "/Users/ted/.composer/auth.json" for future use by Composer.
Token (hidden):
1
2
3
4
5
Could not fetch https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2, please review your configured GitHub OAuth token or enter a new one to access private repos

Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+TED-Mac+2021-09-24+1131
to retrieve a token. It will be stored in "/Users/ted/.composer/auth.json" for future use by Composer.
Token (hidden):

告知超過限制的流量,必須要使用Github Oauth Token 來複寫限制或取得授權
複製他給予的網址並產生驗證Token,並輸入在Terminal,輸入的Token 會存在 auth.json中

查看 Composer 設定檔

1
2
3
4
$ composer config --global --list
...
[github-oauth.github.com] ghp_llUFGX***************hF3IOP3wfKjn
...

Github 有宣布 2021/08/21 之後無法使用密碼來操作Git

產生 Personal Access Token 方法

右上角的頭像 -> Settings -> 左側欄的 Developer settings -> 左側欄的 Personal access tokens

Generate new token 創建新的Token

創建完的Token 只會顯示一次,之後只能刪除或是重新產生

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token