user11262291
user11262291

Reputation:

tymon/jwt-auth package show error in laravel 5.8

I install a new project of Laravel 5.8 but when I install JWT Auth package,

composer require tymon/jwt-auth

it shows an error saying

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.

I tried everything but nothing seems to work for me. Then, I check this link https://github.com/tymondesigns/jwt-auth/issues/1764

how to resolve this?

Upvotes: 2

Views: 6366

Answers (6)

Rafael Cunha
Rafael Cunha

Reputation: 11

Composer requires: tymon/jwt-auth:^1.0.2 --ignore-platform-reqs

Upvotes: 0

ANIK ISLAM SHOJIB
ANIK ISLAM SHOJIB

Reputation: 3258

This package does not support PHP 8.0 yet

You can add composer require tymon/jwt-auth --ignore-platform-reqs

--ignore-platform-reqs works for me, also you need the latest composer.

Upvotes: 3

ohho
ohho

Reputation: 51951

As of today, tymon/jwt-auth is still in pre-release. Check out and install the latest release, for example:

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

Upvotes: 1

Victor Gorban
Victor Gorban

Reputation: 1699

Yes, there's an open issue on github. Solution: composer require tymon/jwt-auth:1.0.0-rc.4.1

To install and properly use this with Laravel 5.8, you need "tymon/jwt-auth": "1.0.0-rc.4.1". NOT 0.5.x and NOT even 1.0.x.

I use it and everything just fine.

Upvotes: 3

Aditya Thakur
Aditya Thakur

Reputation: 2610

In order to install JWTAuth in Laravel 5.8 you need to use following

composer require tymon/jwt-auth:dev-develop

Upvotes: 10

namelivia
namelivia

Reputation: 2745

The package you are trying to install requires carbon 1.x but you are locking carbon at version 2.x. You neeed to downgrade carbon to 1.x, Laravel currently does not require carbon 2 so maybe you required it explicitely on your composer file, or by requiring another package that needs carbon 2.x. If you could post your composer.json file we could look up what package is requiring carbon 2.x.

Upvotes: 1

Related Questions