简体   繁体   中英

Symfony/ possibly Doctrine error on any attempts of calling make:entity

On any attempts to call "php bin/console make:entity" I get the following error:

In DoctrineHelper.php line 180:

Class "Doctrine\Persistence\Mapping\Driver\AnnotationDriver" does not exist

I checked vendor, and it appears there is no file called AnnotationDriver.php there but I'm unsure on how to proceed.

using the following:

  "type": "project",
"license": "proprietary",
"require": {
    "php": ">=7.1.3",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "curl/curl": "^2.3",
    "doctrine/annotations": "^1.13",
    "doctrine/doctrine-bundle": "^2.6",
    "doctrine/doctrine-migrations-bundle": "^3.2",
    "doctrine/orm": "^2.11",
    "easycorp/easyadmin-bundle": "*",
    "friendsofsymfony/rest-bundle": "^3.3",
    "guzzlehttp/guzzle": "^7.4",
    "lcobucci/jwt": "*",
    "nelmio/cors-bundle": "^2.2",
    "phpdocumentor/reflection-docblock": "^5.3",
    "sensio/framework-extra-bundle": "^6.2",
    "symfony/asset": "*",
    "symfony/console": "4.4.*",
    "symfony/dotenv": "4.4.*",
    "symfony/expression-language": "4.4.*",
    "symfony/flex": "^1.3.1",
    "symfony/form": "4.4.*",
    "symfony/framework-bundle": "4.4.*",
    "symfony/http-foundation": "4.4.*",
    "symfony/monolog-bundle": "^3.7",
    "symfony/property-access": "4.4.*",
    "symfony/property-info": "4.4.*",
    "symfony/proxy-manager-bridge": "4.4.*",
    "symfony/security-bundle": "4.4.*",
    "symfony/serializer": "4.4.*",
    "symfony/twig-bundle": "4.4.*",
    "symfony/validator": "4.4.*",
    "symfony/yaml": "4.4.*"
}

in my composer.json. I tried upgrading and downgrading doctrine/orm but it didn't help.

I think you are the same person I just answered on symfony github discussion .

Here is my answer:

So I checked online for a similar issue and I found this .

You need to change your composer.json and downgrade your doctrine/orm to 2.11 until you migrate to symfony 5.4 because symfony 4.4 support has been dropped .

So modify your composer.json with:

"doctrine/orm": "^2.11",

And also:

"conflict": {
        "symfony/symfony": "*",
        "doctrine/orm": "2.12.0"
    },

Don't forget to run composer update

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM