Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

composer update authentication on packagist

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"
    }
}
like image 275
Alxp Avatar asked Mar 10 '15 08:03

Alxp


1 Answers

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.

like image 139
Victor Lengler Avatar answered Sep 28 '22 00:09

Victor Lengler