tymon/jwt auth包在laravel 5.8中显示错误

tymon/jwt auth包在laravel 5.8中显示错误,laravel,Laravel,我安装了Laravel 5.8的一个新项目,但当我安装JWT Auth软件包时 composer require tymon/jwt-auth 这是一个错误的说法 Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for tymon/jwt-auth ^0.5.12 -> satisfiable by tymo

我安装了Laravel 5.8的一个新项目,但当我安装JWT Auth软件包时

composer require tymon/jwt-auth
这是一个错误的说法

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for tymon/jwt-auth ^0.5.12 -> satisfiable by tymon/jwt-auth[0.5.12].
    - Conclusion: remove nesbot/carbon 2.17.0
    - Conclusion: don't install nesbot/carbon 2.17.0
    - tymon/jwt-auth 0.5.12 requires nesbot/carbon ~1.0 -> satisfiable by nesbot/carbon[1.0.0, 1.0.1, 1.1.0, 1.10.0, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 1.2.0, 1.20.0, 1.21.0, 1.22.0, 1.22.1, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.26.0, 1.26.1, 1.26.2, 1.26.3, 1.26.4, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.3.0, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0, 1.34.0, 1.34.1, 1.34.2, 1.34.3, 1.34.4, 1.35.0, 1.35.1, 1.36.0, 1.36.1, 1.36.2, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0].
    - Can only install one of: nesbot/carbon[1.26.3, 2.17.0].
    - Can only install one of: nesbot/carbon[1.26.4, 2.17.0].
    - Can only install one of: nesbot/carbon[1.27.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.28.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.30.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.31.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.31.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.32.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.33.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.3, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.4, 2.17.0].
    - Can only install one of: nesbot/carbon[1.35.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.35.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.0.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.8.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.9.0, 2.17.0].
    - Installation request for nesbot/carbon (locked at 2.17.0) -> satisfiable by nesbot/carbon[2.17.0].


Installation failed, reverting ./composer.json to its original content.
我什么都试过了,但似乎什么都不管用。 然后,我检查这个链接


如何解决此问题?

您试图安装的软件包需要carbon 1.x,但您正在将carbon锁定在2.x版。您需要将carbon降级到1.x,Laravel目前不需要carbon 2,因此您可能在composer文件中明确要求它,或者要求另一个需要carbon 2.x的软件包。
如果您可以发布您的
composer.json
文件,我们可以查找需要carbon 2.x.

的软件包,以便在Laravel 5.8中安装JWTAuth,您需要使用以下命令

composer require tymon/jwt-auth:dev-develop
是的,github上有一个。 解决方案:
composer需要tymon/jwt auth:1.0.0-rc.4.1

要在Laravel 5.8中安装并正确使用它,您需要
“tymon/jwt auth”:“1.0.0-rc.4.1”
。不是
0.5.x
,甚至不是
1.0.x


我使用它,一切都很好。

到今天为止,
tymon/jwtauth
仍在预发布中。签出并安装,例如:

composer require tymon/jwt-auth:1.0.0-rc.5

这个软件包还不支持PHP8.0

您可以添加
composer require tymon/jwt auth--ignore platform reqs


--忽略平台要求
适用于我,您还需要最新的编写器。

您是否尝试安装较旧版本的软件包?检查解决方案。它不支持laravel 5.8版本。使用旧版本,如5.7版本