Composer 安装提供大量错误

Posted

技术标签:

【中文标题】Composer 安装提供大量错误【英文标题】:Composer Install Giving a Ton of Errors 【发布时间】:2018-06-16 23:18:32 【问题描述】:

我正在尝试运行composer install,但出现大量错误。它们是什么意思?

composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install laravel/framework v5.5.28
    - Conclusion: don't install laravel/framework v5.5.27
    - Conclusion: don't install laravel/framework v5.5.26
    - Conclusion: don't install laravel/framework v5.5.25
    - Conclusion: don't install laravel/framework v5.5.24
    - Conclusion: don't install laravel/framework v5.5.23
    - Conclusion: don't install laravel/framework v5.5.22
    - Conclusion: don't install laravel/framework v5.5.21
    - Conclusion: don't install laravel/framework v5.5.20
    - Conclusion: don't install laravel/framework v5.5.19
    - Conclusion: don't install laravel/framework v5.5.18
    - Conclusion: don't install laravel/framework v5.5.17
    - Conclusion: don't install laravel/framework v5.5.16
    - Conclusion: don't install laravel/framework v5.5.15
    - Conclusion: don't install laravel/framework v5.5.14
    - Conclusion: don't install laravel/framework v5.5.13
    - Conclusion: don't install laravel/framework v5.5.12
    - Conclusion: don't install laravel/framework v5.5.11
    - Conclusion: don't install laravel/framework v5.5.10
    - Conclusion: don't install laravel/framework v5.5.9
    - Conclusion: don't install laravel/framework v5.5.8
    - Conclusion: don't install laravel/framework v5.5.7
    - Conclusion: don't install laravel/framework v5.5.6
    - Conclusion: don't install laravel/framework v5.5.5
    - Conclusion: don't install laravel/framework v5.5.4
    - Conclusion: don't install laravel/framework v5.5.3
    - Installation request for davibennun/laravel-push-notification dev-master -> satisfiable by davibennun/laravel-push-notification[dev-master].
    - Conclusion: don't install laravel/framework v5.5.2
    - Conclusion: don't install laravel/framework v5.5.1
    - davibennun/laravel-push-notification dev-master requires illuminate/support 4.* -> satisfiable by illuminate/support[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.24, v4.1.25, v4.1.26, v4.1.27, v4.1.28, v4.1.29, v4.1.3, v4.1.30, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
    - don't install illuminate/support v4.0.0|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.1|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.10|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.2|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.3|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.4|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.5|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.6|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.7|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.8|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.0.9|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.0|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.1|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.10|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.11|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.12|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.13|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.14|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.15|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.16|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.17|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.18|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.19|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.2|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.20|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.21|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.22|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.23|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.24|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.25|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.26|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.27|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.28|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.29|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.3|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.30|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.4|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.5|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.6|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.7|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.8|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.1.9|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.1|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.12|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.16|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.17|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.2|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.3|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.4|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.5|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.6|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.7|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.8|don't install laravel/framework v5.5.0
    - don't install illuminate/support v4.2.9|don't install laravel/framework v5.5.0
    - Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, v5.5.10, v5.5.11, v5.5.12, v5.5.13, v5.5.14, v5.5.15, v5.5.16, v5.5.17, v5.5.18, v5.5.19, v5.5.2, v5.5.20, v5.5.21, v5.5.22, v5.5.23, v5.5.24, v5.5.25, v5.5.26, v5.5.27, v5.5.28, v5.5.3, v5.5.4, v5.5.5, v5.5.6, v5.5.7, v5.5.8, v5.5.9].

这是我的composer.json 文件:


	"name": "laravel/laravel",
	"description": "The Laravel Framework.",
	"keywords": ["framework", "laravel"],
	"license": "MIT",
	"type": "project",
	"require": 
		"laravel/framework": "5.5.*",
	  	"phpunit/phpunit" : "6.0.*",
	  	"doctrine/dbal": "~2.3",
	  	"aws/aws-sdk-php": "2.*",
	  	"zizaco/entrust": "1.2.*@dev",
	  	"mandrill/mandrill": "1.0.54",
	  	"curl/curl": "1.2.0",
	  	"artdarek/oauth-4-laravel": "1.0.5",
	  	"abraham/twitteroauth": "0.7.2",
	  	"davibennun/laravel-push-notification": "dev-master",
	  	"stripe/stripe-php": "4.4.*",
        "intervention/image": "2.1.3",
        "mockery/mockery" : "0.9.4",
        "nesbot/carbon" : "1.*",
        "sendgrid/sendgrid" : "4.0.*",
        "twilio/sdk" : "5.8.0",
		"php-ffmpeg/php-ffmpeg": "^0.6.1",
        "sinergi/browser-detector" : "6.1.2",
        "google/apiclient" : "2.*",
		"sentry/sentry-laravel": "^0.7.0",
        "maatwebsite/excel" : "1.3.10",
		"lizhibin/php-mcrypt": "dev-master"
	,
    "require-dev" : 
        "phpdocumentor/phpdocumentor": "2.*"
    ,
	"autoload": 
		"classmap": [
			"app/commands",
			"app/controllers",
			"app/models",
			"app/database/migrations",
			"app/database/seeds",
			"app/tests/TestCase.php",
		  	"app/helpers",
            "app/jobs"
		]
	,
	"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 artisan key:generate"
		]
	,
	"config": 
		"preferred-install": "dist"
	,
	"minimum-stability": "stable"

php -v 返回:

PHP 7.1.12-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Dec 14 2017 15:37:13) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.12-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.0~linux-x64-non_zts71, https://blackfire.io, by SensioLabs

谁能帮我弄清楚这意味着什么?我已经做了一些研究,但我一直被这些错误所困扰。

我正在 Homestead/Vagrant 中运行我的 Laravel 项目

【问题讨论】:

您可以使用prohibits command 测试 require 失败的结果。例如php composer.phar why-not laravel/framework v5.5.28 实际上,davibennun/laravel-push-notification dev-master 似乎需要 illuminate/support 4.*,laravel 将其依赖项的版本号与您安装的版本相匹配。有一个对 laravel 5 支持的拉取请求github.com/davibennun/laravel-push-notification/pull/187 【参考方案1】:

我相信你引入了错误版本的 davibennun/laravel-push-notification 包 - 看起来你的 composer.json 文件引用了 "davibennun/laravel-push-notification": "dev-master" 但是我相信你需要 "davibennun/laravel-push-notification": "dev-laravel5" 才能使用 Laravel 5。

请看这里https://github.com/davibennun/laravel-push-notification。

【讨论】:

以上是关于Composer 安装提供大量错误的主要内容,如果未能解决你的问题,请参考以下文章

Composer [UnexpectedValueException] 错误将尝试使用 composer 安装 github 项目

Composer 安装时出现 SSL 错误

安装 Composer - 内部错误

Php致命错误:使用composer安装用户捆绑时内存大小耗尽

安装 Composer 失败并出现“缺少 openssl 扩展”错误

Composer 安装错误,要求从系统路径中删除