作曲家依赖冲突
Composer dependency conflict
运行 这个 composer require intervention/image
抛出这个错误:
Using version ^2.3 for intervention/image
./composer.json has been updated
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 intervention/image 2.3.1
- Conclusion: don't install intervention/image 2.3.2
- Installation request for intervention/image ^2.3 -> satisfiable by intervention/image[2.3.0, 2.3.1, 2.3.2].
- intervention/image 2.3.0 requires guzzlehttp/psr7 ~1.1 -> satisfiable by guzzlehttp/psr7[1.1.0, 1.2.0].
- guzzlehttp/psr7 1.1.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
- guzzlehttp/psr7 1.2.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
- Conclusion: don't install psr/http-message 1.0
Installation failed, reverting ./composer.json to its original content.
所以这是由 Guzzle 引起的(我正在使用 "guzzlehttp/guzzle": "~5.3"
)。但我不能(或不想)将 guzzle 更新到 6.0,因为它不向后兼容,所以我必须移动大量代码。我可以做点什么,比如变戏法,还是必须更新 guzzlehttp/guzzle
或 intervention/image
?
是的。你可以尝试使用aliases。
可能是这样的:
"guzzlehttp/guzzle": "~5.3 as 6.0"
您可能会使用别名让 Composer 认为 guzzle 的 v5.3.0 实际上是 v6.0。
定义 "guzzlehttp/guzzle": "~5.3 as 6.0"
将不起作用,因为那只是一个无效字符串。您必须具体说明版本并插入 5.3.0,如下所示:
composer.json
{
"require": {
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "5.3.0 as 6.0"
}
}
您也可以更新您的代码以使用 guzzlehttp/guzzle
v6,但这可能比更改 composer.json 中的几个字符更有效。 ,)
It's a trick but it won't work. You can have a look at @Sven answer.
很明显你没有测试我发布的内容。别名版本是完成它的一种方法。它不是解决所有依赖问题的圣杯。解决版本冲突的简单方法
[50.2MB/9.02s] - Installing react/promise (v2.2.1)
[50.6MB/9.07s] Reading C:/Users/koch/AppData/Local/Composer/files/react/promise/3b6fca09c7d56321057fa8867c8dbe1abf648627.zip from cache
[50.6MB/9.08s] Loading from cache
[50.6MB/9.08s] Extracting archive
[50.7MB/9.47s]
[50.7MB/9.48s] REASON: guzzlehttp/ringphp 1.1.0 requires react/promise ~2.0 -> satisfiable by react/promise[v2.0.0, v2.1.0, v2.2.0, v2.2.1].
[50.7MB/9.48s]
[50.7MB/9.49s] - Installing guzzlehttp/streams (3.0.0)
[50.7MB/9.53s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/streams/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5.zip from cache
[50.7MB/9.54s] Loading from cache
[50.7MB/9.54s] Extracting archive
[50.7MB/9.92s]
[50.7MB/9.93s] REASON: guzzlehttp/ringphp 1.1.0 requires guzzlehttp/streams ~3.0 -> satisfiable by guzzlehttp/streams[3.0.0].
[50.7MB/9.93s]
[50.7MB/9.94s] - Installing guzzlehttp/ringphp (1.1.0)
[50.7MB/10.01s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/ringphp/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b.zip from cache
[50.7MB/10.02s] Loading from cache
[50.7MB/10.02s] Extracting archive
[50.7MB/10.41s]
[50.7MB/10.41s] REASON: guzzlehttp/guzzle 5.3.0 requires guzzlehttp/ringphp ^1.1 -> satisfiable by guzzlehttp/ringphp[1.1.0].
[50.7MB/10.41s]
[50.7MB/10.43s] - Installing guzzlehttp/guzzle (5.3.0)
[50.7MB/10.49s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/guzzle/f3c8c22471cb55475105c14769644a49c3262b93.zip from cache
[50.7MB/10.51s] Loading from cache
[50.7MB/10.51s] Extracting archive
[50.7MB/11.66s]
[50.7MB/11.66s] REASON: Required by root: Install command rule (install guzzlehttp/guzzle 5.3.0)
[50.7MB/11.66s]
[50.7MB/11.69s] - Installing psr/http-message (1.0)
[50.7MB/11.77s] Reading C:/Users/koch/AppData/Local/Composer/files/psr/http-message/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298.zip from cache
[50.7MB/11.78s] Loading from cache
[50.7MB/11.78s] Extracting archive
[50.7MB/11.91s]
[50.7MB/11.91s] REASON: guzzlehttp/psr7 1.2.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
[50.7MB/11.91s]
[50.7MB/11.94s] - Installing guzzlehttp/psr7 (1.2.0)
[50.7MB/11.98s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/psr7/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e.zip from cache
[50.7MB/11.98s] Loading from cache
[50.7MB/11.98s] Extracting archive
[50.7MB/12.61s]
[50.7MB/12.61s] REASON: intervention/image 2.3.2 requires guzzlehttp/psr7 ~1.1 -> satisfiable by guzzlehttp/psr7[1.1.0, 1.2.0].
[50.7MB/12.61s]
[50.7MB/12.64s] - Installing intervention/image (2.3.2)
[50.7MB/12.73s] Reading C:/Users/koch/AppData/Local/Composer/files/intervention/image/1124ff3c6298f0dcf9edf9156623904d7a5c3428.zip from cache
[50.7MB/12.74s] Loading from cache
[50.7MB/12.74s] Extracting archive
[50.7MB/14.72s]
[50.7MB/14.72s] REASON: Required by root: Install command rule (install intervention/image 2.3.0|install intervention/image 2.3.1|install intervention/image 2.3.2)
[50.7MB/14.72s]
[50.3MB/15.09s] intervention/image suggests installing ext-gd (to use GD library based image processing.)
[50.3MB/15.10s] intervention/image suggests installing ext-imagick (to use Imagick based image processing.)
[50.3MB/15.11s] intervention/image suggests installing intervention/imagecache (Caching extension for the Intervention Image library)
[50.4MB/15.17s] Writing lock file
使用别名方法有一个严重的缺点:它不起作用!
我怀疑你对 Guzzle 5 的使用是你发送消息的原因,但为了进行更多调查,我需要你的 composer.json
的内容,可能还需要你的 composer.lock
文件。
这里添加的依赖并不复杂。 intervention/image
取决于 guzzlehttp/psr7 ~1.1
,后者取决于 psr/http-message ~1.0
。 Guzzle 包是一个全新的包,以前版本的 Guzzle 5.x 没有使用过,PSR 包也不应该与任何东西冲突——但这正是 Composer 检测到的。然而,在 Composer 中解密 SAT 求解器的错误消息并不容易。求解器可以轻松地为您创建适用于所有要求的解决方案,但很难找出失败的原因。如果可能的话,作曲家会为你做的。
有一个工具可以帮助人类调试这种情况:https://packagist.org/packages/clue/graph-composer
这是一个命令行工具,最好和composer global require clue/graph-composer
一起安装,另外还需要"graphviz"安装。在您现有的项目上使用它会显示所有当前存在的包依赖项,并且可能会为您提供可能出错的线索。
运行 这个 composer require intervention/image
抛出这个错误:
Using version ^2.3 for intervention/image
./composer.json has been updated
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 intervention/image 2.3.1
- Conclusion: don't install intervention/image 2.3.2
- Installation request for intervention/image ^2.3 -> satisfiable by intervention/image[2.3.0, 2.3.1, 2.3.2].
- intervention/image 2.3.0 requires guzzlehttp/psr7 ~1.1 -> satisfiable by guzzlehttp/psr7[1.1.0, 1.2.0].
- guzzlehttp/psr7 1.1.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
- guzzlehttp/psr7 1.2.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
- Conclusion: don't install psr/http-message 1.0
Installation failed, reverting ./composer.json to its original content.
所以这是由 Guzzle 引起的(我正在使用 "guzzlehttp/guzzle": "~5.3"
)。但我不能(或不想)将 guzzle 更新到 6.0,因为它不向后兼容,所以我必须移动大量代码。我可以做点什么,比如变戏法,还是必须更新 guzzlehttp/guzzle
或 intervention/image
?
是的。你可以尝试使用aliases。 可能是这样的:
"guzzlehttp/guzzle": "~5.3 as 6.0"
您可能会使用别名让 Composer 认为 guzzle 的 v5.3.0 实际上是 v6.0。
定义 "guzzlehttp/guzzle": "~5.3 as 6.0"
将不起作用,因为那只是一个无效字符串。您必须具体说明版本并插入 5.3.0,如下所示:
composer.json
{
"require": {
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "5.3.0 as 6.0"
}
}
您也可以更新您的代码以使用 guzzlehttp/guzzle
v6,但这可能比更改 composer.json 中的几个字符更有效。 ,)
It's a trick but it won't work. You can have a look at @Sven answer.
很明显你没有测试我发布的内容。别名版本是完成它的一种方法。它不是解决所有依赖问题的圣杯。解决版本冲突的简单方法
[50.2MB/9.02s] - Installing react/promise (v2.2.1)
[50.6MB/9.07s] Reading C:/Users/koch/AppData/Local/Composer/files/react/promise/3b6fca09c7d56321057fa8867c8dbe1abf648627.zip from cache
[50.6MB/9.08s] Loading from cache
[50.6MB/9.08s] Extracting archive
[50.7MB/9.47s]
[50.7MB/9.48s] REASON: guzzlehttp/ringphp 1.1.0 requires react/promise ~2.0 -> satisfiable by react/promise[v2.0.0, v2.1.0, v2.2.0, v2.2.1].
[50.7MB/9.48s]
[50.7MB/9.49s] - Installing guzzlehttp/streams (3.0.0)
[50.7MB/9.53s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/streams/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5.zip from cache
[50.7MB/9.54s] Loading from cache
[50.7MB/9.54s] Extracting archive
[50.7MB/9.92s]
[50.7MB/9.93s] REASON: guzzlehttp/ringphp 1.1.0 requires guzzlehttp/streams ~3.0 -> satisfiable by guzzlehttp/streams[3.0.0].
[50.7MB/9.93s]
[50.7MB/9.94s] - Installing guzzlehttp/ringphp (1.1.0)
[50.7MB/10.01s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/ringphp/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b.zip from cache
[50.7MB/10.02s] Loading from cache
[50.7MB/10.02s] Extracting archive
[50.7MB/10.41s]
[50.7MB/10.41s] REASON: guzzlehttp/guzzle 5.3.0 requires guzzlehttp/ringphp ^1.1 -> satisfiable by guzzlehttp/ringphp[1.1.0].
[50.7MB/10.41s]
[50.7MB/10.43s] - Installing guzzlehttp/guzzle (5.3.0)
[50.7MB/10.49s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/guzzle/f3c8c22471cb55475105c14769644a49c3262b93.zip from cache
[50.7MB/10.51s] Loading from cache
[50.7MB/10.51s] Extracting archive
[50.7MB/11.66s]
[50.7MB/11.66s] REASON: Required by root: Install command rule (install guzzlehttp/guzzle 5.3.0)
[50.7MB/11.66s]
[50.7MB/11.69s] - Installing psr/http-message (1.0)
[50.7MB/11.77s] Reading C:/Users/koch/AppData/Local/Composer/files/psr/http-message/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298.zip from cache
[50.7MB/11.78s] Loading from cache
[50.7MB/11.78s] Extracting archive
[50.7MB/11.91s]
[50.7MB/11.91s] REASON: guzzlehttp/psr7 1.2.0 requires psr/http-message ~1.0 -> satisfiable by psr/http-message[1.0].
[50.7MB/11.91s]
[50.7MB/11.94s] - Installing guzzlehttp/psr7 (1.2.0)
[50.7MB/11.98s] Reading C:/Users/koch/AppData/Local/Composer/files/guzzlehttp/psr7/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e.zip from cache
[50.7MB/11.98s] Loading from cache
[50.7MB/11.98s] Extracting archive
[50.7MB/12.61s]
[50.7MB/12.61s] REASON: intervention/image 2.3.2 requires guzzlehttp/psr7 ~1.1 -> satisfiable by guzzlehttp/psr7[1.1.0, 1.2.0].
[50.7MB/12.61s]
[50.7MB/12.64s] - Installing intervention/image (2.3.2)
[50.7MB/12.73s] Reading C:/Users/koch/AppData/Local/Composer/files/intervention/image/1124ff3c6298f0dcf9edf9156623904d7a5c3428.zip from cache
[50.7MB/12.74s] Loading from cache
[50.7MB/12.74s] Extracting archive
[50.7MB/14.72s]
[50.7MB/14.72s] REASON: Required by root: Install command rule (install intervention/image 2.3.0|install intervention/image 2.3.1|install intervention/image 2.3.2)
[50.7MB/14.72s]
[50.3MB/15.09s] intervention/image suggests installing ext-gd (to use GD library based image processing.)
[50.3MB/15.10s] intervention/image suggests installing ext-imagick (to use Imagick based image processing.)
[50.3MB/15.11s] intervention/image suggests installing intervention/imagecache (Caching extension for the Intervention Image library)
[50.4MB/15.17s] Writing lock file
使用别名方法有一个严重的缺点:它不起作用!
我怀疑你对 Guzzle 5 的使用是你发送消息的原因,但为了进行更多调查,我需要你的 composer.json
的内容,可能还需要你的 composer.lock
文件。
这里添加的依赖并不复杂。 intervention/image
取决于 guzzlehttp/psr7 ~1.1
,后者取决于 psr/http-message ~1.0
。 Guzzle 包是一个全新的包,以前版本的 Guzzle 5.x 没有使用过,PSR 包也不应该与任何东西冲突——但这正是 Composer 检测到的。然而,在 Composer 中解密 SAT 求解器的错误消息并不容易。求解器可以轻松地为您创建适用于所有要求的解决方案,但很难找出失败的原因。如果可能的话,作曲家会为你做的。
有一个工具可以帮助人类调试这种情况:https://packagist.org/packages/clue/graph-composer
这是一个命令行工具,最好和composer global require clue/graph-composer
一起安装,另外还需要"graphviz"安装。在您现有的项目上使用它会显示所有当前存在的包依赖项,并且可能会为您提供可能出错的线索。