gpt4 book ai didi

laravel - 使用 composer 安装 Laravel 包的问题

转载 作者:行者123 更新时间:2023-12-05 06:08:44 30 4
gpt4 key购买 nike

我想在我的项目中使用一个包。

Composer .json:

"require": {
"php": "^7.2.5|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"hekmatinasser/verta": "^1.11",
"laravel/framework": "^7.29",
"laravel/passport": "^9.3",
"laravel/tinker": "^2.5",
"lcobucci/jwt": "3.3.3",
"pishran/zarinpal": "^2.2"
},

我要安装的目标包:

composer require ipecompany/smsirlaravel

问题:当我在 composer 上尝试这个时,我看到以下错误

Problem 1
- ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.2
.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires ipecompany/smsirlaravel ^1.0 -> satisfiable by ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7].

我试过了:

composer require ipecompany/smsirlaravel -W

但主要问题是 Laravel Passport 可能是因为以下错误:

  Problem 1
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.

我尝试安装 laminas/laminas-diactoros ^2.2 但我遇到了另一个错误

problem 1
- Root composer.json requires laminas/laminas-diactoros 2.2, found laminas/laminas-diactoros[2.2.0] but it conflicts with another require.
Problem 2
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.

任何人都可以帮我安装这个包吗? TNX

最佳答案

如第一条错误消息中所写:ipecompany/smsirlaravel 需要 Guzzle v6,但目前已安装 v7。您应该首先对 Guzzle 使用不同的版本约束:将 "guzzlehttp/guzzle": "^6.3.1|^7.0.1" 更改为 "guzzlehttp/guzzle": "^6.3. 1"。然后,运行 composer update guzzlehttp/guzzle 以安装 Guzzle v6。

之后,运行 composer require ipecompany/smsirlaravel 应该可以工作

关于laravel - 使用 composer 安装 Laravel 包的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65059705/

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