当试图用auth0安装php-jwt时遇到麻烦

时间:2017-03-01 13:17:06

标签: php composer-php jwt 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.

为了更好地理解截图,请点击此处。

enter image description here

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

1 个答案:

答案 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"

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