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


Github authentication issue while installing yii php framework

我试图安装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文件中。为什么不重复使用?

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

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

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

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