当我想把laravel 9升级到10时,我得到了依赖性错误,我该怎么解决这个问题?

bzzcjhmw  于 2023-03-04  发布在  其他
关注(0)|答案(1)|浏览(302)

在我的composer.json文件中
以前的依赖关系是:

"require": {
        "php": "^8.0.2",
        "darkaonline/l5-swagger": "^8.4",
        "ejarnutowski/laravel-api-key": "^1.0",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^9.19",
        "laravel/sanctum": "^3.0",
        "laravel/tinker": "^2.7",
        "spatie/laravel-activitylog": "^4.7",
        "spatie/laravel-permission": "^5.8",
        "tomfordrumm/jwt-auth": "dev-develop"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.7",
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },`

现在我已经将依赖项升级为:

"require": {
        "php": "^8.1",
        "darkaonline/l5-swagger": "^8.4",
        "ejarnutowski/laravel-api-key": "^1.0",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^10.0",
        "laravel/sanctum": "^3.2",
        "laravel/tinker": "^2.8",
        "spatie/laravel-activitylog": "^4.7",
        "spatie/laravel-permission": "^5.8",
        "tomfordrumm/jwt-auth": "dev-develop"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.7",
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.0",
        "spatie/laravel-ignition": "^2.0.0"
    },

但我有这样的错误:
无法将您的要求解析为一组可安装的程序包。

Problem 1
- illuminate/support[v5.6.0, ..., v5.8.36] require php ^7.1.3 -> your php version (8.2.2) does not satisfy that requirement.
- illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.2.2) does not satisfy that requirement.
- illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.2.2) does not satisfy that requirement.
- illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.2.2) does not satisfy that requirement.
- Root composer.json requires tomfordrumm/jwt-auth dev-develop -> satisfiable by tomfordrumm/jwt-auth[dev-develop].
- Conclusion: don't install laravel/framework v10.0.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.0.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.4 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.1.5 (conflict analysis result)
- Conclusion: don't install laravel/framework v10.0.1 (conflict analysis result)
- tomfordrumm/jwt-auth dev-develop requires illuminate/support ^5.2|^6|^7|^8|^9 -> satisfiable by illuminate/support[v5.2.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.4].
- Only one of these can be installed: illuminate/support[v5.2.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.4, v10.0.0, ..., v10.1.5], laravel/framework[v10.0.0, ..., v10.1.5]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.1.5].

使用选项--with-all-dependencies(-W)允许升级、降级和删除当前锁定到特定版本的软件包。
我的php版本是:PHP 8.2.2语言

    • 我试过**

编写器更新-具有所有相关性
还将tomfordrumm/jwt-auth变更为tymon/jwt-auth,但仍存在相同错误

    • 在文件中:**

PHP 8.1.0要求Laravel现在需要PHP 8. 1. 0或更高版本。
Composer 2.2.0要求Laravel现在需要Composer 2. 2. 0或更高版本。
您应该更新应用程序的composer.json文件中的以下依赖项:

  • laravel/框架到^10.0
  • laravel/密室到^3.2
  • 理论/数据库到^3.0
  • spatie/laravel-点火至^2.0

如果您要从2.x版本系列升级到Sanctum 3.x,请参阅Sanctum升级指南。
此外,如果您希望使用PHPUnit 10,则应该从应用程序的phpunit.xml配置文件的节中删除processUncoveredFiles属性,然后更新应用程序的composer.json文件中的以下依赖项:

  • nunomaduro/碰撞到^7.0
  • 马力单位/马力单位到^10.0

最后,检查您的应用程序使用的任何其他第三方包,并验证您使用的是支持Laravel 10的正确版本。
最小稳定性您应该将应用程序composer.json文件中的最小稳定性设置更新为稳定:
"最小稳定性":"稳定",
应用

6jygbczu

6jygbczu1#

tomfordrumm/jwt-auth的最新版本不支持laravel v10。因此,从composer中删除tomfordrumm/jwt-auth并添加此包:
“tymon/jwt-auth”:“^2.0”

相关问题