4
votes

Suddenly my Composer has stopped working.

Whenever I run composer update, it doesn't progress after this:

Loading composer repositories with package information
Updating dependencies (including require-dev)

I tried another Laravel project, that project's Composer was working

I cleared the cache, and also ran this command rm -rf ~/.composer/cache

Nothing seems to happen. I moved composer.lock to a different folder, deleted from the current project and ran the commands again, but no luck

Here is my composer.json file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "nesbot/carbon": "~1.14",
        "venturecraft/revisionable": "~1.8",
        "doctrine/dbal": "v2.4.2",
        "zizaco/entrust": "dev-laravel-5",
        "aws/aws-sdk-php-laravel": "~3.0",
        "guzzlehttp/guzzle": "~5.2",
        "league/flysystem-aws-s3-v2": "~1.0",
        "sofa/revisionable": "~1.0@dev",
        "maatwebsite/excel": "~2.0.0",
        "monolog/monolog": "^1.15",
        "jenssegers/agent": "^2.2",
        "php-mime-mail-parser/php-mime-mail-parser": "^2.1",
        "messaged/php-mime-mail-parser": "^1.0",
        "willdurand/email-reply-parser": "^2.4",
        "barryvdh/laravel-debugbar": "~2.0.2"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "Validations\\": "app/Validations"
        },
        "files": [
            "app/Support/helpers.php"
        ]
    },
    "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"
    }
}
1
usually it takes some time at this step Updating dependencies (including require-dev) did you give it a minute or three? What happens if you run composer install instead of update?Pᴇʜ
I agree with Peh- give it more time. If you give it enough time it'll show the error or work.Mikel Bitson
I waited 20 minutes. Same two lines, nothing else. No errors, no progress.nirvair
And already tried composer install -v and composer install. Just those two lines. Installing instead of Updating.nirvair
Could you try running composer for this project on another machine? I pulled your composer.json file, had to get rid of the App\Validations psr-4 call and the app/support/helpers file call and the TestCase classmap, because I have none of them on my machine... however, when I ran the install I got this error: devimg.next-www.com/20151203105910-001.png Do you have ext-mailparse installed on your machine?Mikel Bitson

1 Answers

1
votes

I made some Tests and it looks like these two packages in combination cause the problem:

"aws/aws-sdk-php-laravel": "~3.0",
"league/flysystem-aws-s3-v2": "~1.0",

They install properly each for itself but not together. I used a fresh Laravel 5.1 install for testing (composer create-project laravel/laravel --prefer-dist). After adding only these two packages to the composer.json Composer is stuck at

Updating dependencies (including require-dev)

If you remove one of them your composer update runs fine. I don't know anything about these two packages but the combination definitely crashes Composer even in -verbose mode.


The crashing composer.json as minimal example:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "aws/aws-sdk-php-laravel": "~3.0",
        "league/flysystem-aws-s3-v2": "~1.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "Validations\\": "app/Validations"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}