composer update authentication on packagist
Asked Answered
C

2

7

I have a problem with the composer update for my project made in laravel 5. Everytime I want to update the composer with other packages (from Packagist) I get an authentication box (not suposed to be one) and then even if I input my github/packagist account or not I end like this:

Loading composer repositories with package information
Updating dependencies (including require-dev)
    Authentication required (packagist.org):
      Username:
      Password:



  [Composer\Downloader\TransportException]
  Invalid credentials for 'http://packagist.org/p/doctrine/inflector$caf0d38e
  3001eb2cbabe4192f701affcc10254307a3c01fa6b41a5579b2b648e.json', aborting.

I tried until now, to install composer after deleting vendor's folder and composer lock, but again the auth is appearing. I made another laravel project but I start with lot's of vendor folder (like doctrine inflector), and they need auth. I also tried a github token, on composer json.

Anyone knows what is the problem? Thank you in advance.

D:\Code\pricer>composer diagnose
Checking composer.json: OK
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
 Disabling it when using Composer is recommended.
Checking git settings: OK
Checking http connectivity: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

I don't have problems with the rate limit for an auth and platform settings fail because of xdebug.

And when I am deleting that package and installing composer again

  Problem 1
    - laravel/framework v5.0.14 requires doctrine/inflector ~1.0 -> no matching
package found.
    - laravel/framework v5.0.14 requires doctrine/inflector ~1.0 -> no matching
package found.

Composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*",
        "illuminate/html": "5.0.*@dev",
        "doctrine/dbal": "2.6.*@dev"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
Carmellacarmelle answered 10/3, 2015 at 8:12 Comment(6)
Could you show us your composer.json? Have you tried without doctrine/inflector package? What's the output if so?Longbow
I wrote all those informations in the main post:dCarmellacarmelle
Thanks. I'd try installing packages step by step (to new directory) and observe what fail and when. Just tried myself and was successful. Via console: composer require "laravel/framework:5.0.*", composer require "illuminate/html:5.0.*@dev", composer require "doctrine/dbal:2.6.*@dev"Longbow
I've tried your way buy nothing good happened. Then I removed homestead/vagrant/composer/php 5.4(wamp) and reinstalled them all with a php version 5.5.12, and now I can't even to use the composer commands [ErrorException] fopen(): Filename cannot be emptyCarmellacarmelle
Thank you, I'll try myself the rest, I think my computer has a problem and if it's fixed then everything will gonna be alright:dCarmellacarmelle
I solved the part with the fopen(), but now it prompts me again for auth. link to error with composer -vvvCarmellacarmelle
O
3

I had this problem with authentication, so I ran this code:

composer config --global repo.packagist composer https://packagist.org

Then I ran the update again and it worked!

Try it yourself.

Opiumism answered 5/11, 2018 at 15:37 Comment(1)
Thanks for your valuable comment You saved my lifeSalientian
A
0

It is actually a port problem. It is unable to connect to a specific port because of blocking of ports on your system by your admin. Which is the reason why it is asking for this authentication.

Try connecting to a home network or mobile network and do the composer update. It should go smooth without asking for credentials.

Do mark it as answer if this worked for you.

Affective answered 25/4, 2017 at 16:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.