php 指定了不存在的目录/vich/uploader-bundle作为原则Map源

nqwrtyyt  于 2023-01-12  发布在  PHP
关注(0)|答案(2)|浏览(100)

我尝试安装/更新我的软件包,但是,当我运行composer install,时,我得到了以下错误。
指定了不存在的目录“/home/wwwroot/htdocs/vendor/vich/uploader-bundle/Resources/config/doctrine”作为原则Map源。
这是否与 composer 版本有关?版本太旧还是太新?我是否缺少配置?我尝试切换和播放版本,但我找不到解决方案。

** 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.*"
        }
    }
}
mwkjh3gx

mwkjh3gx1#

在我的例子中,我在5.3版本中安装了symfony/doctrine-bridge依赖项,它可以正常工作:
composer require "symfony/doctrine-bridge":"5.3.*"

xienkqul

xienkqul2#

对于任何在尝试升级到Symfony 5.4时仍然存在这个问题的人,VichUploaderBundle project siteissue 1282中解决了这个问题。
您需要确保Doctrine/DoctrineBundle是2.5+版本。Symfony/doctrine-bridge是其他Symfony软件包的先决条件,所以它已经包含在内,可能在升级时已经升级,所以降级没有帮助(至少对我来说)。

相关问题