【问题标题】:Authentication required (packagist.org) Laravel installation需要身份验证 (packagist.org) Laravel 安装
【发布时间】:2017-02-08 17:27:39
【问题描述】:

我正在使用 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:

任何建议或谁能告诉我在这里缺少什么?

【问题讨论】:

  • 您是否在使用某种代理?您是否尝试过 composer install -vvv 以获得更多调试信息?
  • 感谢您的回复,我运行了命令 composer install -vvv 但在中间我得到了下面显示的错误[Composer\Downloader\TransportException] Invalid credentials for 'http://packagist.org/p/symfony/polyfill-mbstring%24c9c4d394bcfc0f197c6dd5c0524fa35a32f2dd07a0c9d208d04811248115b0 e6.json', aborting. 不知道现在该做什么...任何其他建议

标签: php laravel-5 composer-php


【解决方案1】:

运行composer config --global repo.packagist composer https://packagist.org,然后重试。这应该可以防止它使用 http 协议并强制使用 https,这可能会在您遇到错误代理的情况下修复它。

【讨论】:

    【解决方案2】:

    就我而言,解决了以下问题:

    $ 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 之后,问题得到了解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-17
      • 2014-03-05
      • 1970-01-01
      • 2018-02-20
      • 2021-11-22
      • 2017-02-18
      • 2021-10-10
      相关资源
      最近更新 更多