gpt4 book ai didi

php - Composer 安装/更新停止工作

转载 作者:可可西里 更新时间:2023-10-31 23:38:31 29 4
gpt4 key购买 nike

我的 Composer 突然停止工作了。

每当我运行 composer update 时,它都不会在这之后进行:

Loading composer repositories with package information
Updating dependencies (including 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 后卡在

Updating dependencies (including require-dev)

如果您删除其中之一,您的 composer 更新 运行正常。我对这两个包一无所知,但即使在 -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"
}
}

关于php - Composer 安装/更新停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34070023/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com