Gay*_*tri 5 php composer-php laravel-5
我正在使用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:
Run Code Online (Sandbox Code Playgroud)
这是我面临的问题,我不知道我要提供什么用户名,以及为什么要求身份验证..如果我运行,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:
Run Code Online (Sandbox Code Playgroud)
任何建议或任何人都可以告诉我在这里缺少什么?
小智 12
运行"composer config --global repo.packagist composer https://packagist.org ",然后再试一次.这应该可以防止它使用http协议和强制https,这可能会修复它,以防您在路上遇到错误的代理.
就我而言,解决了以下问题:
$ 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
Run Code Online (Sandbox Code Playgroud)
我跑的
$ 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]
Run Code Online (Sandbox Code Playgroud)
然后我又跑了
$ composer self-update
Run Code Online (Sandbox Code Playgroud)
但是,在安装包的过程中,它仍然显示:
Authentication required (repo.packagist.org):
Username:
Run Code Online (Sandbox Code Playgroud)
在提供了我的 packagist.org 帐户的用户名和密码并将我的凭据存储在 中后/Users/xxx/.composer/auth.json,问题得到了解决。