Composer 无法在 symfony 4 上要求 symfony/symfony

Composer fail to require symfony/symfony on symfony 4

我已经通过 composer 使用以下行安装了最新版本的 symfony:

composer create-project symfony/skeleton whatever

然后按照此 page 上的说明,我决定需要整个框架,因此我不必通过输入以下内容来一一安装所有捆绑包:

composer require symfony/symfony

但问题是我最终遇到以下错误:

composer require symfony/symfony
Using version ^4.0 for symfony/symfony
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/symfony v4.0.0 conflicts with __root__[No version set (parsed as 1.0.0)].
    - symfony/symfony v4.0.1 conflicts with __root__[No version set (parsed as 1.0.0)].
    - symfony/symfony v4.0.2 conflicts with __root__[No version set (parsed as 1.0.0)].
    - Installation request for __root__ No version set (parsed as 1.0.0) -> satisfiable by __root__[No version set (parsed as 1.0.0)].
    - Installation request for symfony/symfony ^4.0 -> satisfiable by symfony/symfony[v4.0.0, v4.0.1, v4.0.2].


Installation failed, reverting ./composer.json to its original content.

当我指定版本 4.0.2 时,我少了 2 个错误,但问题仍然存在:

composer require symfony/symfony v4.0.2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for __root__ No version set (parsed as 1.0.0) -> satisfiable by __root__[No version set (parsed as 1.0.0)].
    - symfony/symfony v4.0.2 conflicts with __root__[No version set (parsed as 1.0.0)].
    - Installation request for symfony/symfony v4.0.2 -> satisfiable by symfony/symfony[v4.0.2].


Installation failed, reverting ./composer.json to its original content.

我的composer.json:

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-iconv": "*",
        "sensiolabs/security-checker": "^4.1",
        "symfony/console": "^4.0",
        "symfony/flex": "^1.0",
        "symfony/framework-bundle": "^4.0",
        "symfony/lts": "^4@dev",
        "symfony/yaml": "^4.0"
    },
    "require-dev": {
        "symfony/dotenv": "^4.0",
        "symfony/thanks": "^1.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\Tests\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
            "security-checker security:check": "script"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "id": "0133333333333333337ed17ed",
            "allow-contrib": false
        }
    }
}

我很困惑,我在 symfony 文档上找不到太多关于这个的信息,而且我对作曲家的了解还很远,有什么线索吗?

symfony/skeleton 包设计用于 Symfony Flex。该项目的重点是避免使用整个框架,因此包明确与之冲突。

您应该从 symfony/framework-standard-edition 创建您的项目,这将引入整个框架,或者利用 Flex 中的新功能仅引入组件或 "recipes" 您需要。