Skip to content
Advertisement

Symfony 5 can’t install sensio/generator-bundle

i tried a fresh new symfony 5 project, but i cannot install the generator bundle to ease everything with doctrine entities.

It seems that Symfony 5 is too new to install the generator bundle.

Here is the output of the composer command to add the sensio generator bundle:

 composer require sensio/generator-bundle
Using version ^3.1 for sensio/generator-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - sensio/generator-bundle v3.1.7 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.6 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.5 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.4 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.3 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.2 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle v3.1.1 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - sensio/generator-bundle 3.1.0 requires symfony/framework-bundle ~2.7|~3.0 -> no matching package found.
    - Installation request for sensio/generator-bundle ^3.1 -> satisfiable by sensio/generator-bundle[3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

and here is my composer.json file

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": ">=7.2.5",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/doctrine-migrations-bundle": "^3.0",
        "doctrine/orm": "^2.7",
        "sensio/framework-extra-bundle": "^5.6",
        "symfony/asset": "5.1.*",
        "symfony/console": "5.1.*",
        "symfony/dotenv": "5.1.*",
        "symfony/flex": "^1.3.1",
        "symfony/framework-bundle": "5.1.*",
        "symfony/twig-bundle": "5.1.*",
        "symfony/webpack-encore-bundle": "^1.7",
        "symfony/yaml": "5.1.*",
        "twig/extra-bundle": "^2.12|^3.0",
        "twig/twig": "^2.12|^3.0"
    },
    "require-dev": {
        "symfony/maker-bundle": "^1.22"
    },
    "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-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.*"
        }
    }
}

Advertisement

Answer

This bundle does not support Symfony 4 and 5.Use the Maker bundle instead.

maker bundle :

https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement