安装yii php框架时出现Github身份验证问题

时间:2015-01-30 13:09:32

标签: php github yii

我尝试安装yii php框架。我使用以下命令来安装该框架:
1. composer global require "fxp/composer-asset-plugin:~1.0"
2. composer create-project yiisoft/yii2-app-advanced advanced 2.0.2
这是输出:

Installing yiisoft/yii2-app-advanced (2.0.2)
  - Installing yiisoft/yii2-app-advanced (2.0.2)
    Downloading: 100%         

Created project in advanced
Loading composer repositories with package information
Installing dependencies (including require-dev)
Reading bower.json of bower-asset/jquery.inputmask (3.1.50)
Could not fetch https://api.github.com/repos/RobinHerbots/jquery.inputmask/contents/bower.json?ref=f44d5deec804c72fe85da31819b18bdcdad26f65, enter your GitHub credentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in /home/ajay/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: akulkarni9
Password: 
Token successfully created

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 /home/ajay/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: akulkarni9
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 /home/ajay/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: akulkarni9
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 /home/ajay/.composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username: 

我不明白为什么github一次又一次地问我的github usernamepassword。我认为OAuth token将存储在/home/<username>/.composer/auth.json文件中。为什么不重复使用它?

2 个答案:

答案 0 :(得分:2)

乍一看,这看起来像是Composer的一个错误。幸运的是,Composer背后的团队正在不断改进它并发布新版本。

使用composer self-update更新Composer可能会解决问题。

在这种情况下,OP在上面的评论中报告说它有效。

答案 1 :(得分:0)

您需要登录GitHub帐户。然后在https://github.com/settings/tokens/new创建具有所需范围的新令牌。生成的令牌可以在安装Yii2时作为OAuth令牌提供。