通过composer安装yii2时一直提示输入密码

3

我只是按照yii网站上的指示操作,对composer不是很了解。我按照这里的指示进行操作http://www.yiiframework.com/doc-2.0/guide-start-installation.html

认证似乎正在工作,但是它一遍又一遍地提示我输入用户名/密码。

有人能给我一些检查的建议,看看为什么会一直提示我输入呢?

[root@dndbox html]# composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (dev-master b528289495bf9721d2b8c628d69caad42e45b0ce)
  - Installing yiisoft/yii2-app-basic (dev-master master)
    Downloading: connection...
Could not fetch https://api.github.com/repos/yiisoft/yii2-app-basic/zipball/b528289495bf9721d2b8c628d69caad42e45b0ce, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password: 
An existing OAuth token for Composer is present and will be reused

Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: *.com
Password: 
An existing OAuth token for Composer is present and will be reused

Could not fetch https://api.github.com/authorizations, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /root/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: 

如果我访问提供的URL,会收到JSON中的错误消息:https://api.github.com/authorizations
{
  "message": "API rate limit exceeded for xxx.xxx.xxx.26. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}
3个回答

13

这可能会帮助您更多。按照以下步骤进行操作:

  1. 创建/登录Github帐户。
  2. 转到个人资料>>设置>>个人访问令牌(或)单击此https://github.com/settings/tokens链接。
  3. 单击生成新令牌
  4. 选择适当的范围并单击生成令牌
  5. 复制令牌密钥,并在Composer要求您输入令牌时将其粘贴(例如:Token (Hidden):)

现在就进入安装过程吧。

祝你好运!



-1
  1. 创建一个Github账户。
  2. 前往https://github.com/s...gs/applications并删除在yii2安装期间生成的先前令牌。
  3. 创建一个新的令牌。
  4. 运行此命令:composer config -g github-oauth.github.com
  5. 再次尝试yii2的安装。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接