報(bào)錯(cuò)信息如下:
$ brew search nginx
Warning: Error searching on GitHub: GitHub API Error: Requires authentication
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
? printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist,repo,workflow&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
==> Formulae
nginx
?其中最重要的信息是 “The GitHub credentials in the macOS keychain may be invalid.”,翻譯為:“macOS密鑰鏈中的GitHub憑據(jù)可能無效”。憑證無效就重新生成就好了。生成方式如下:
1、登錄github
Sign in to GitHub · GitHub
2、訪問生成token地址
Sign in to GitHub · GitHub
3、生成token
??
4、設(shè)置新的token?
在終端執(zhí)行命令:
export HOMEBREW_GITHUB_API_TOKEN="新生成的token"
設(shè)置完再次執(zhí)行brew命令測(cè)試效果如下
文章來源:http://www.zghlxwxcb.cn/news/detail-496622.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-496622.html
到了這里,關(guān)于Mac系統(tǒng)brew報(bào)錯(cuò)“The GitHub credentials in the macOS keychain may be invalid”解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!