Symfony 5 无法安装 sensio/generator-bundle

Ty *_*ayn -2 php symfony composer-php

我尝试了一个全新的 symfony 5 项目,但我无法安装生成器包来简化所有与学说实体的事情。

Symfony 5 似乎太新,无法安装生成器包。

这是添加 sensio 生成器包的 composer 命令的输出:

 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.
Run Code Online (Sandbox Code Playgroud)

这是我的 composer.json 文件

{
    "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.*"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

小智 5

此捆绑包不支持 Symfony 4 和 5。请改用 Maker 捆绑包。

制造商捆绑:

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