Symfony - ORM Pack conflict with symfony/dependency-injection on installation

Viewed 58

I am using Symfony for the first time and I have created a new project using the following command listed in their documentation:

symfony new my_project_directory

Everything works fine up to this point and the project is created without problems, the problem occurs when I try to install the ORM Pack. I use the following command, that are listed in the Symfony documentation:

composer require symfony/orm-pack

But I have this error:

enter image description here

Using version ^2.3 for symfony/orm-pack
./composer.json has been updated
Running composer update symfony/orm-pack
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "6.1.*"
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/framework-bundle is locked to version v6.1.4 and an update of this package was not requested.
    - symfony/orm-pack v2.3.0 conflicts with symfony/dependency-injection <6.2.
    - symfony/framework-bundle v6.1.4 requires symfony/dependency-injection ^6.1 -> satisfiable by symfony/dependency-injection[v6.1.3].
    - Root composer.json requires symfony/orm-pack ^2.3 -> satisfiable by symfony/orm-pack[v2.3.0].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require symfony/orm-pack:*" to figure out if any version is installable, or "composer require symfony/orm-pack:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

My composer.json is the basic one that Symfony installs, without any new libraries added:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "symfony/console": "6.1.*",
        "symfony/dotenv": "6.1.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.1.*",
        "symfony/runtime": "6.1.*",
        "symfony/yaml": "6.1.*"
    },
    "require-dev": {
    },
    "config": {
        "allow-plugins": {
            "composer/package-versions-deprecated": true,
            "symfony/flex": true,
            "symfony/runtime": true
        },
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*"
    },
    "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": "6.1.*"
        }
    }
}

I am using Symfony 6.1 on Windows in the WSL2. What could be the problem? I have only used the steps listed in the Symfony documentation.

Thanks in advance!

1 Answers

Use command: composer require symfony/orm-pack:^2.1

Related