Q
Q
Quber2013-11-28 05:57:43
symfony
Quber, 2013-11-28 05:57:43

Why does an error appear when installing repositories via composer and how to fix it?

Installed composer. Then through it Symfony 2. Then I installed several bundles for SF2.
When installing some bundles, errors occur, while installing others do not. What is the magic? Others somehow download and install these repositories?
Here is an example, when installing "sonata-project/news-bundle" the following is displayed in the console:

$ composer.phar update sonata-project/news-bundle
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
    - Conclusion: remove symfony/symfony v2.3.7
    - Installation request for sonata-project/news-bundle dev-master -> satisfiable by sonata-project/news-bundle[dev-master].
    - friendsofsymfony/user-bundle v1.3.0 requires symfony/security-bundle 2.1.* -> satisfiable by symfony/symfony[2.1.x-dev, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2
.1.8, v2.1.9], symfony/security-bundle[2.1.x-dev, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9].
    - friendsofsymfony/user-bundle v1.3.1 requires symfony/security-bundle >=2.1,<2.3-dev -> satisfiable by symfony/symfony[2.1.x-dev, 2.2.x-dev, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5
, v2.1.6, v2.1.7, v2.1.8, v2.1.9, v2.2.0, v2.2.1, v2.2.10, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9], symfony/security-bundle[2.1.x-dev, 2.2.x-dev, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2
, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9, v2.2.0, v2.2.1, v2.2.10, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9].
    - Can only install one of: symfony/symfony[v2.3.7, 2.1.x-dev].
    - Can only install one of: symfony/symfony[v2.3.7, 2.2.x-dev].
..................................
- don't install symfony/security-bundle v2.1.8|don't install symfony/symfony v2.3.7
    - don't install symfony/security-bundle v2.1.9|don't install symfony/symfony v2.3.7
    - Installation request for symfony/symfony == 2.3.7.0 -> satisfiable by symfony/symfony[v2.3.7].
    - Conclusion: remove friendsofsymfony/user-bundle dev-master|install friendsofsymfony/user-bundle v1.3.0|install friendsofsymfony/user-bundle v1.3.1
    - sonata-project/news-bundle dev-master requires sonata-project/user-bundle ~2.2 -> satisfiable by sonata-project/user-bundle[2.2.0, 2.2.x-dev].
    - sonata-project/user-bundle 2.2.0 requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3].
    - sonata-project/user-bundle 2.2.x-dev requires friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[1.3.x-dev, v1.3.0, v1.3.1, v1.3.2, v1.3.3].
    - Can only install one of: friendsofsymfony/user-bundle[dev-master, 1.3.x-dev].
    - Can only install one of: friendsofsymfony/user-bundle[v1.3.2, dev-master].
    - Can only install one of: friendsofsymfony/user-bundle[v1.3.3, dev-master].
    - Installation request for friendsofsymfony/user-bundle dev-master -> satisfiable by friendsofsymfony/user-bundle[dev-master].

Tried to understand the error text, but did not understand what he wants. Posted in problem 1: Remove Symphony2. Damn, why should I delete it if the bundle won't work without it? In short, I can’t figure it out, please help.
Composer.json file
{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/easy-extends-bundle": "dev-master",
        "sonata-project/news-bundle": "dev-master",
        "friendsofsymfony/user-bundle": "dev-master",
        "friendsofsymfony/comment-bundle": "dev-master",
        "knplabs/knp-menu-bundle":"1.1.*",
        "knplabs/knp-paginator-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2013-11-28
@Quber

There is nothing to write dev-master in package versions. You have problems with dependency versions. Namely:
friendsofsymfony/user-bundle v1.3.0 requires symfony/security-bundle 2.1.*
In his suggestions, he suggests deleting symfony/security-bundle instead of symfony, or changing the version of fos/user-bundle. Most likely the culprit of this whole thing is the sonata / user-bundle, which just needs to register the desired version.
ps with a sonata you can't afford the luxury of being a "dev-master" because developers love to break everything this way even in minor releases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question