laravel/lumen-installer 安装失败:guzzlehttp/guzzle 锁定在 6.3.0
Posted
技术标签:
【中文标题】laravel/lumen-installer 安装失败:guzzlehttp/guzzle 锁定在 6.3.0【英文标题】:Installation failed for laravel/lumen-installer: guzzlehttp/guzzle locked at 6.3.0 【发布时间】:2018-07-03 19:37:06 【问题描述】:我正在尝试通过命令composer global require "laravel/lumen-installer"
安装 Lumen,但在终端上抛出以下错误。
Changed current directory to /home/lykos/.config/composer
Using version ^1.0 for laravel/lumen-installer
./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 laravel/lumen-installer v1.0.2
- Conclusion: don't install laravel/lumen-installer v1.0.1
- Installation request for symfony/console (locked at v4.0.3) -> satisfiable by symfony/console[v4.0.3].
- Conclusion: remove guzzlehttp/guzzle 6.3.0
- Installation request for laravel/lumen-installer ^1.0 -> satisfiable by laravel/lumen-installer[v1.0.0, v1.0.1, v1.0.2].
- Conclusion: don't install guzzlehttp/guzzle 6.3.0
- laravel/lumen-installer v1.0.0 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6, 4.1.7, 4.1.8, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.2.0, 5.3.0, 5.3.1, 5.3.2].
- Can only install one of: guzzlehttp/guzzle[4.0.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.0.1, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.0.2, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.1, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.2, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.3, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.4, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.5, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.6, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.7, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.1.8, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.2.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.2.1, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.2.2, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.2.3, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[4.2.4, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.0.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.0.1, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.0.2, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.0.3, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.1.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.2.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.3.0, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.3.1, 6.3.0].
- Can only install one of: guzzlehttp/guzzle[5.3.2, 6.3.0].
- Installation request for guzzlehttp/guzzle (locked at 6.3.0) -> satisfiable by guzzlehttp/guzzle[6.3.0].
Installation failed, reverting ./composer.json to its original content.
通过谷歌搜索,我尝试这样做rm -R ~/.composer/vendor/guzzlehttp
但由于没有这样的目录而引发错误
rm: cannot remove '/home/lykos/.composer/vendor/guzzlehttp': No such file or directory
我的~/.config/composer/composer.json
文件如下所示
"require":
"laravel/installer": "^1.5"
任何想法如何解决这个问题?
【问题讨论】:
您无法删除~/.composer/vendor/guzzlehttp
,因为它没有安装。你能给我们看看你的 composer.json 吗?
我该怎么做?
尝试运行这个:composer global require guzzlehttp/guzzle
@Jeff Mattson 更新了我的主帖
你给我的最后一行Using version ^6.3 for guzzlehttp/guzzle ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Writing lock file Generating autoload files
【参考方案1】:
你应该用composer clearcache
清除缓存然后运行
composer global require "laravel/lumen-installer"
这主要是因为 composer 缓存了一些包并尝试从缓存中安装所需的包。
尝试使用composer create-project --prefer-dist laravel/lumen project
安装
希望这会有所帮助。
【讨论】:
@Lykos 尝试使用 composer create-project --prefer-dist laravel/lumen 安装【参考方案2】:Taylor 在 v1.0.3 中修复了此问题,但尚未标记,因此您可以安装 dev-master 以获取更新版本:
composer global require laravel/lumen-installer:dev-master
【讨论】:
【参考方案3】:尝试删除全局~/.composer
目录。先安装lumen/installer
,再安装laravel/installer
全局。对我来说很好。
【讨论】:
【参考方案4】:我今天也遇到了同样的问题,是由其他一些全局需要的包引起的,请检查~/.composer/composer.json
。在我的情况下,laravel/install
2.0.1 想要 guzzle
6.0.0 而旧的 lumen/install
想要 guzzle
5.3.2,但 Composer 只能允许安装一个版本。通过删除流明线并在该目录中运行 composer update 解决了问题。
【讨论】:
【参考方案5】:laravel/lumen-installer v1.0.0 需要
guzzlehttp/guzzle
~4.0|~5.0
guzzlehttp/guzzle
的安装请求(锁定在6.3.0
)
这意味着guzzlehttp/guzzle
根据您的composer.lock
文件锁定在6.3.0
",并且您的包(laravel/lumen-installer
)需要guzzlehttp/guzzle ~4.0|~5.0
。通过grep 6.3.0 ~/.composer/composer.lock
命令检查它。
因此,您需要根据建议从您的~/.composer/composer.json
中删除guzzlehttp/guzzle
:
结论:删除
guzzlehttp/guzzle
6.3.0
否则,如果它不存在,则需要删除依赖它的包,或将laravel/lumen-installer
升级到 v1.0.3(如前所述)。例如
composer global require laravel/lumen-installer:^1.0.3
要查看依赖树(使用不同版本的guzzle
),可以运行:
composer global show -t
另请参阅:How to resolve a "Can only install one of:" conflict?
【讨论】:
以上是关于laravel/lumen-installer 安装失败:guzzlehttp/guzzle 锁定在 6.3.0的主要内容,如果未能解决你的问题,请参考以下文章