突然我的Composer停止了工作。
每当我运行composer update
时,它都不会在此之后继续:
正在加载包含包信息的composer存储库
更新依赖项(包括require-dev)
我尝试了另一个Laravel项目,该项目的Composer正在工作
我清除了缓存,还运行了这个命令rm -rf ~/.composer/cache
似乎什么都没发生。我把composer.lock
移到另一个文件夹,从当前项目中删除,然后再次运行命令,但没有成功
这是我的composer.json
文件:
{
"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"
}
}
我做了一些测试,看起来这两个包组合在一起导致了问题:
"aws/aws-sdk-php-laravel": "~3.0",
"league/flysystem-aws-s3-v2": "~1.0",
它们各自正确安装,但不能一起安装。我使用了一个全新的Laravel 5.1安装进行测试(composer create-project laravel/laravel --prefer-dist
)。在仅将这两个包添加到composer.json
之后,Composer被困在
更新依赖项(包括require-dev)
如果删除其中一个,则composer update
运行良好。我对这两个包一无所知,但即使在-verbose
模式下,组合也肯定会使Composer崩溃。
以崩溃的composer.json
为例:
{
"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"
}
}