我正在使用Ubuntu 16.04并尝试安装Laravel (任何版本)。实际上,我从GitHub克隆了Laravel项目(https://github.com/laravel/laravel),在克隆之后,我正在运行以下命令:
root:/var/www/html/laravel$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Authentication required (packagist.org):
Username: 这就是我面临的问题,我不知道我必须提供什么用户名,也不知道为什么要进行身份验证。如果我运行composer diagnose,我会得到这样的输出:
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Authentication required (packagist.org):
Username:有什么建议吗?有人能告诉我这里遗漏了什么吗?
发布于 2018-10-16 21:38:27
请运行composer config --global repo.packagist composer https://packagist.org,然后重试。这应该阻止它使用http协议,并强制https,这可能会修复它的情况下,你有一个坏的代理的方式。
发布于 2018-09-04 19:44:14
在我的例子中,解决了如下问题:
$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: WARNING
You are not running the latest stable version, run `composer self-update` to update (1.6.3 => 1.7.2)
Composer version: 1.6.3
PHP version: 7.2.8
PHP binary path: /usr/local/Cellar/php/7.2.8/bin/php我跑了
$ composer self-update --update-keys
Open https://composer.github.io/pubkeys.html to find the latest keys
Enter Dev / Snapshot Public Key (including lines with -----):
[copy and paste the dev pub key]
Enter Tags Public Key (including lines with -----):
[copy and paste the tags pub key]然后,我又跑了
$ composer self-update但是,在安装程序包的过程中,仍然会显示:
Authentication required (repo.packagist.org):
Username:在为我的packagist.org帐户提供我的用户名和密码并将我的凭据存储在/Users/xxx/.composer/auth.json中之后,问题就解决了。
https://stackoverflow.com/questions/39786363
复制相似问题