我试图安装php-jwt。当我输入以下命令时
composer require firebase/php-jwt
它会出现以下错误。
Using version ^4.0 for firebase/php-jwt
./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
- auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
- auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
- auth0/auth0-php 4.0.12 requires firebase/php-jwt ^3.0 -> satisfiable by firebase/php-jwt[v3.0.0] but these conflict with your requirements or minimum-stability.
- Installation request for auth0/auth0-php (locked at 4.0.12, required as ~4.0) -> satisfiable by auth0/auth0-php[4.0.12].
Installation failed, reverting ./composer.json to its original content.
为了更好地理解截图,请点击此处。
我已经尝试了很多,但无法找到任何好的解决方案。
答案 0 :(得分:2)
那是因为您正在尝试安装php-jwt
的最新版本:4.0
,如packagist.org所示。
在同一时间是另一个软件包 - 似乎auth0
使用的是php-jwt
的旧版本3.0,因此您必须安装版本为3.0的php-jwt
如下:
composer require firebase/php-jwt:^3.0
或强>
将您的auth0
软件包更新为使用php-jwt
最新主要版本的最新版本,如here:
"firebase/php-jwt" : "^4.0"
注意:在更新软件包之前,请不要忘记备份项目。