尝试安装 php-jwt 时遇到 auth0 问题

When trying to install php-jwt facing trouble with auth0

我正在尝试安装 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.

为了更好地理解,请在此处提供屏幕截图。

我已经尝试了很多,但找不到任何好的解决方案。

那是因为您正在尝试安装最新版本的 php-jwt,即:4.0,如 packagist.org 所示。

同时这是另一个软件包 - 似乎是 auth0 使用旧版本的 php-jwt,即 3.0,因此您必须安装 php-jwt 的版本3.0如下:

composer require firebase/php-jwt:^3.0

将您的 auth0 软件包更新到最新版本,该版本使用 php-jwt 的最新主要版本,如 here:

所示
"firebase/php-jwt" : "^4.0"

注意:在更新包之前不要忘记备份项目。