composer install/update trigger Class Doctrine\Common\Cache\ArrayCache 不存在

composer install/update trigger Class Doctrine\Common\Cache\ArrayCache does not exist

我正在使用 symfony5 并想在今天早些时候进行部署,但由于 composer installcomposer update 供应商加载时出现以下错误而失败:

根据这个问题,这个问题对某些人有用,错误可能来自我的学说版本,但由于我在过去几天没有更新它,我不明白它怎么会

这是我的 composer.json 案例:

{
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=7.4",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "ext-zip": "*",
        "api-platform/core": "^2.5",
        "beberlei/doctrineextensions": "^1.3",
        "composer/package-versions-deprecated": "^1.11",
        "digitick/sepa-xml": "^2.1",
        "doctrine/annotations": "^1.0",
        "doctrine/doctrine-bundle": "^2.1",
        "doctrine/doctrine-migrations-bundle": "^3.0",
        "doctrine/orm": "^2.7",
        "gesdinet/jwt-refresh-token-bundle": "^0.9.1",
        "giggsey/libphonenumber-for-php": "^8.12",
        "guzzlehttp/guzzle": "^7.0",
        "h4cc/wkhtmltopdf-amd64": "^0.12.4",
        "jsor/doctrine-postgis": "^1.7",
        "knplabs/knp-snappy-bundle": "^1.8",
        "lcobucci/jwt": "^3.3",
        "lexik/jwt-authentication-bundle": "^2.8",
        "nelmio/cors-bundle": "^2.1",
        "phpdocumentor/reflection-docblock": "^5.2",
        "ramsey/uuid": "^4.1",
        "sensio/framework-extra-bundle": "^5.6",
        "stof/doctrine-extensions-bundle": "^1.5",
        "stripe/stripe-php": "^7.62",
        "symfony/amqp-messenger": "5.1.*",
        "symfony/asset": "5.1.*",
        "symfony/console": "5.1.*",
        "symfony/dependency-injection": "5.1.*",
        "symfony/dotenv": "5.1.*",
        "symfony/expression-language": "5.1.*",
        "symfony/flex": "^1.3.1",
        "symfony/framework-bundle": "5.1.*",
        "symfony/http-client": "5.1.*",
        "symfony/mailer": "5.1.*",
        "symfony/mercure-bundle": "^0.2.5",
        "symfony/messenger": "5.1.*",
        "symfony/monolog-bundle": "^3.6",
        "symfony/property-access": "5.1.*",
        "symfony/property-info": "5.1.*",
        "symfony/security-bundle": "5.1.*",
        "symfony/serializer": "5.1.*",
        "symfony/translation": "5.1.*",
        "symfony/twig-bundle": "5.1.*",
        "symfony/validator": "5.1.*",
        "symfony/yaml": "5.1.*",
        "twig/cssinliner-extra": "^3.1",
        "twig/extra-bundle": "^2.12|^3.0",
        "twig/inky-extra": "^3.1",
        "twig/twig": "^2.12|^3.0",
        "twilio/sdk": "^6.16",
        "vich/uploader-bundle": "^1.16"
    },
    "require-dev": {
        "api-platform/schema-generator": "^2.2",
        "dama/doctrine-test-bundle": "^6.4",
        "doctrine/doctrine-fixtures-bundle": "^3.3",
        "fzaninotto/faker": "^1.9",
        "justinrainbow/json-schema": "^5.2",
        "symfony/browser-kit": "^5.1",
        "symfony/css-selector": "^5.1",
        "symfony/debug-bundle": "^5.1",
        "symfony/maker-bundle": "^1.21",
        "symfony/phpunit-bridge": "^5.1",
        "symfony/stopwatch": "^5.1",
        "symfony/var-dumper": "^5.1",
        "symfony/web-profiler-bundle": "^5.1"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\Tests\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "5.1.*"
        }
    }
}

有谁知道这个错误可能来自哪里,或者可以想到可能的解决方案,因为我被困在这个问题上

谢谢

更新

composer install -v

的结果

正如您在 doctrine/cacheissue posted in the issue tracker 中所读到的,class 已在该软件包的 v1 中弃用,并在 v2 中删除。

如果您仍想使用那个 class,运行 composer require doctrine/cache "^1.12" 从 v1 分支安装该软件包的一个版本。


在长 运行 上,您应该检查您的应用程序在哪里需要 class 并搜索替代方案。如果您需要这方面的帮助,请分享更多详细信息。