【问题标题】:Problems installing tymon jwt auth in Laravel 9在 Laravel 9 中安装 tymon jwt auth 的问题
【发布时间】:2022-02-16 21:16:37
【问题描述】:

请我在 Laravel 9 中安装时遇到问题。我不知道可能是 tymon jwt auth 尚未与 Laravel 9 兼容。这是我遇到的错误。

当我跑composer require tymon/jwt-auth:

Problem 1
- Root composer.json requires tymon/jwt-auth ^0.5.12 -> satisfiable by tymon/jwt-auth[0.5.12].
- tymon/jwt-auth 0.5.12 requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require tymon/jwt-auth:*" to figure out if any version is installable, or "composer require tymon/jwt-auth:^2.1" if you know which you need.

当我跑composer require tymon/jwt-auth "^1.0":

Problem 1
- tymon/jwt-auth dev-develop requires illuminate/auth ^5.2|^6|^7|^8 -> found illuminate/auth[v5.2.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- tymon/jwt-auth 1.0.0-alpha1 requires illuminate/auth 5.1.* || 5.2.* -> found illuminate/auth[v5.1.1, ..., 5.2.x-dev] but these were not loaded, likely because it conflicts with another require.
- tymon/jwt-auth[1.0.0-alpha.2, ..., 1.0.0-rc.4.1] require php ^5.5.9 || ^7.0 -> your php version (8.1.1) does not satisfy that requirement.
- tymon/jwt-auth[1.0.0-rc.5, ..., 1.0.2] require php ^5.5.9|^7.0 -> your php version (8.1.1) does not satisfy that requirement.
- tymon/jwt-auth 1.0.x-dev is an alias of tymon/jwt-auth dev-develop and thus requires it to be installed too.
- Root composer.json requires tymon/jwt-auth ^1.0 -> satisfiable by tymon/jwt-auth[1.0.0-alpha1, ..., 1.0.x-dev (alias of dev-develop)].

当我跑composer require tymon/jwt-auth:"dev-develop":

Problem 1
- Root composer.json requires tymon/jwt-auth dev-develop -> satisfiable by tymon/jwt-auth[dev-develop].
- tymon/jwt-auth dev-develop requires illuminate/auth ^5.2|^6|^7|^8 -> found illuminate/auth[v5.2.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.

当我运行 composer require tymon/jwt-auth:*

    - tymon/jwt-auth[dev-dependabot/composer/yoast/phpunit-polyfills-tw-1.0.0, dev-dependabot/add-v2-config-file, dev-develop, 1.0.x-dev] require illuminate/auth ^5.2|^6|^7|^8 -> found illuminate/auth[v5.2.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - tymon/jwt-auth 2.0.x-dev requires php ^7.4 -> your php version (8.1.1) does not satisfy that requirement.
    - tymon/jwt-auth[0.1.0, ..., 0.3.6] require illuminate/support 4.2.* -> found illuminate/support[v4.2.0-BETA1, ..., 4.2.x-dev] but these were not loaded, likely because it conflicts with another require.
    - tymon/jwt-auth[0.3.7, ..., 0.4.3] require illuminate/support ~4.0 -> found illuminate/support[v4.0.0-BETA2, ..., 4.2.x-dev] but these were not loaded, likely because it conflicts with another require.
    - tymon/jwt-auth[dev-master, 0.5.0, ..., 0.5.12] require illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - tymon/jwt-auth 1.0.0-alpha1 requires illuminate/auth 5.1.* || 5.2.* -> found illuminate/auth[v5.1.1, ..., 5.2.x-dev] but these were not loaded, likely because it conflicts with another require.
    - tymon/jwt-auth[1.0.0-alpha.2, ..., 1.0.0-rc.4.1] require php ^5.5.9 || ^7.0 -> your php version (8.1.1) does not satisfy that requirement.
    - tymon/jwt-auth[1.0.0-rc.5, ..., 1.0.2] require php ^5.5.9|^7.0 -> your php version (8.1.1) does not satisfy that requirement.
    - tymon/jwt-auth 1.0.x-dev is an alias of tymon/jwt-auth dev-develop and thus requires it to be installed too.
    - Root composer.json requires tymon/jwt-auth * -> satisfiable by tymon/jwt-auth[dev-dependabot/composer/yoast/phpunit-polyfills-tw-1.0.0, dev-dependabot/add-v2-config-file, dev-master, dev-develop, 0.1.0, ..., 0.5.12, 1.0.0-alpha1, ..., 1.0.x-dev (alias of dev-develop), 2.0.x-dev].```

【问题讨论】:

标签: php laravel jwt


【解决方案1】:

缺少composer.json 的更新

我用过这个:

composer require tomfordrumm/jwt-auth:dev-develop

【讨论】:

  • 请分享更多细节。 “缺少 composer.json 更新是什么意思?为什么要安装任何其他软件包来解决给定的问题?
猜你喜欢
  • 2019-05-22
  • 2018-03-31
  • 2016-09-16
  • 2017-06-10
  • 2020-01-08
  • 1970-01-01
  • 2020-05-11
  • 2019-09-13
  • 1970-01-01
相关资源
最近更新 更多