Composer 安装东西遇到github需要token怎么办

安装yii2遇到这样的提示:

Could not fetch https://api.github.com/repos/jquery/sizzle/contents/bower.json?ref=917b312f1d0777d3cccf6ceace2621bb9e8009b2, please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+JIAN-PC+2017-05-11+1400
to retrieve a token. It will be stored in “C:/Users/Administrator/AppData/Roaming/Composer/auth.json” for future use by Composer.

这时候只要输入一个token就可以了,这个token在哪里创建或者获取呢?在这https://github.com/settings/tokens/,如果没有账号先注册一个github账号。这是github为了控制下载速度,避免资源被滥用采取的措施。

第一步:创建新的token

github创建token

点击右上角Generate new token(初始化新的token).

第二步:填写token相关信息

填写token相关信息

写 Token description,也就是这token的描述,方便自己下次查看token了解这个token用在哪里,什么时候创建的,用来干嘛。Select scopes选项都打勾就可以,打勾了这个就不限制你速度。然后最底下点击Generate token 即可得到授权的token.

第三部:把得到的token填写到报需要填写token的地方,重新执行刚才要执行的composer安装执行即可。

本人博客地址:Composer 安装东西遇到github需要token怎么办

原文地址:https://www.cnblogs.com/jianqingwang/p/6840738.html