使用 composer 以 PHP 8 安装时包出错

Error in packages while installing with PHP 8 using composer

我想要 运行 laravel 我从 Gitlab 存储库克隆的应用程序。但是,虽然 运行ning composer update 命令将我抛出错误。

环境:

php -v: PHP 8.0.1

composer --version: 2.0.9

我了解 PHP 8 尚未提供对所有软件包的支持。但仍在寻找 运行 我在本地机器上的项目的最小工作解决方案。

我尝试了 laravel 中的以下 article。但也无法安装“fakerphp/faker”。

  Problem 1
    - 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.0.1; overridden via config.platform, same as actual) 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.0.1; overridden via config.platform, same as actual) does not satisfy that requirement.
    - doctrine/inflector[v1.2.0, ..., 1.2.x-dev] require php ^7.0 -> your php version (8.0.1; overridden via config.platform, same as actual) does not satisfy that requirement.
    - doctrine/inflector[v1.3.0, ..., 1.3.x-dev] require php ^7.1 -> your php version (8.0.1; overridden via config.platform, same as actual) does not satisfy that requirement.
    - doctrine/inflector[1.4.0, ..., 1.4.1, 2.0.0, ..., 2.0.1] require php ^7.2 -> your php version (8.0.1; overridden via config.platform, same as actual) 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.
    - Conclusion: don't install tymon/jwt-auth dev-develop (conflict analysis result)


composer.json


    "require": {
        "php": "^7.4|^8.0",
        "ext-zip": "*",
        "consoletvs/charts": "^7.1",
        "facade/ignition": "^2.5",
        "fideloper/proxy": "^4.0",
        "guzzlehttp/guzzle": "^7.2",
        "intervention/image": "^2.5",
        "laravel/framework": "^8.14",
        "laravel/passport": "^10.0",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^3.1",
        "phpoffice/phpspreadsheet": "^1.16",
        "sentry/sentry-laravel": "^2.3",
        "tymon/jwt-auth": "^1.0",
        "zanysoft/laravel-zip": "^1.0"
    },

我什至删除了我的 composer.lock 并尝试 运行ning composer install 但仍然出现错误。

感谢@RWD 指出了确切的问题。

删除 "tymon/jwt-auth": "^1.0 包后。更新中。

PHP 8 Doesn't provide support yet.