我正在使用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
,我会得到此输出:< / p>
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Authentication required (packagist.org):
Username:
任何建议或任何人都可以告诉我在这里失踪了什么?
答案 0 :(得分:10)
运行composer config --global repo.packagist composer https://packagist.org
,然后重试。这样可以防止它使用http协议,并强制使用https来修复它,以防万一您的代理服务器不正确。
答案 1 :(得分:0)
就我而言,解决了以下问题:
$ 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
之后,此问题已解决。