编程语言
首页 > 编程语言> > PHP-作曲家未能在symfony 4上要求symfony / symfony

PHP-作曲家未能在symfony 4上要求symfony / symfony

作者:互联网

我通过以下行通过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 doc上找到很多有关此的信息,而且我与作曲家相距甚远,有什么线索吗?

解决方法:

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

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

标签:symfony4,symfony,composer-php,php
来源: https://codeday.me/bug/20191110/2013970.html