简体   繁体   中英

Specified non-existing directory /vich/uploader-bundle as Doctrine mapping source

I'm trying to install/update my packages. However, when I run composer install, I get the following error.

Specified non-existing directory "/home/wwwroot/htdocs/vendor/vich/uploader-bundle/Resources/config/doctrine" as Doctrine mapping source.

Does this have something to do with the composer versions? Is a version too old or too new? Am I missing a config? I tried switching and playing around with the versions, but I can't find a solution.

composer.json

    {
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "dev",
    "prefer-stable" : true,
    "require": {
        "php": "^8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "doctrine/annotations": "*",
        "doctrine/doctrine-bundle": "2.3.*",
        "doctrine/doctrine-migrations-bundle": "*",
        "doctrine/orm": "2.8.2",
        "easycorp/easyadmin-bundle": "3.2.7",
        "jms/serializer": "^3.12",
        "jms/serializer-bundle": "^3.9",
        "lexik/jwt-authentication-bundle": "*",
        "lexik/translation-bundle": "5.2.0",
        "nelmio/api-doc-bundle": "^4.2",
        "nelmio/cors-bundle": "^2.1",
        "phpdocumentor/reflection-docblock": "^5.4",
        "phpstan/phpdoc-parser": "^1.4",
        "sensio/framework-extra-bundle": "^5.4",
        "symfony/asset": "5.4.*",
        "symfony/console": "5.4.*",
        "symfony/dotenv": "5.4.*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "5.4.*",
        "symfony/framework-bundle": "5.4.*",
        "symfony/mailer": "5.4.*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/property-access": "5.4.*",
        "symfony/property-info": "5.4.*",
        "symfony/proxy-manager-bridge": "5.4.*",
        "symfony/security-bundle": "*",
        "symfony/security-guard": "*",
        "symfony/serializer": "5.4.*",
        "symfony/swiftmailer-bundle": "^3.5",
        "symfony/twig-bundle": "5.4.*",
        "symfony/validator": "5.4.*",
        "symfony/yaml": "5.4.*",
        "symfonycasts/reset-password-bundle": "*",
        "vich/uploader-bundle": "^1.17"
    },
    "require-dev": {
        "phpunit/phpunit": "^9.5",
        "symfony/browser-kit": "5.4.*",
        "symfony/css-selector": "5.4.*",
        "symfony/debug-bundle": "5.4.*",
        "symfony/maker-bundle": "^1.0",
        "symfony/phpunit-bridge": "^5.2",
        "symfony/stopwatch": "5.4.*",
        "symfony/web-profiler-bundle": "5.4.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true,
        "secure-http": false,
        "allow-plugins": {
            "symfony/flex": 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-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.4.*"
        }
    }
}

In my case, I installed the symfony/doctrine-bridge dependency in version 5.3 and it works:

composer require "symfony/doctrine-bridge":"5.3.*"

For anyone still having this problem when trying to upgrade to Symfony 5.4, the VichUploaderBundle project site addressed this in issue 1282 .

You need to make sure doctrine/DoctrineBundle is version 2.5+. Note: Symfony/doctrine-bridge is a prerequisite of other Symfony packages so it is already included and probably already upgraded when they are upgraded so it doesn't help to downgrade (at least for me).

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