FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

composer update problem

Open Kifah opened this issue 14 years ago • 7 comments

Whenever i run php composer.phar update on my symfony 2.1 project, i get the following error

https://gist.github.com/3780366

here are the relevant parts of my composer.json

"jms/serializer-bundle":"dev-master", "friendsofsymfony/rest-bundle": "dev-master", ...

Kifah avatar Sep 25 '12 07:09 Kifah

Your composer.json must have these two lines:

"jms/serializer-bundle":"dev-master", "friendsofsymfony/rest-bundle": "*",

It will work then.

kristofvc avatar Sep 25 '12 07:09 kristofvc

I have an equivalent problem:

When I run php composer.phar install I have this error:

Loading composer repositories with package information                 
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: friendsofsymfony/rest 0.7.x-dev, friendsofsymfony/rest 0.8.x-dev.
    - Can only install one of: friendsofsymfony/rest 0.8.x-dev, friendsofsymfony/rest 0.7.x-dev.
    - Can only install one of: friendsofsymfony/rest 0.8.x-dev, friendsofsymfony/rest 0.7.x-dev.
    - Installation request for friendsofsymfony/rest == 0.7.9999999.9999999-dev -> satisfiable by friendsofsymfony/rest 0.7.x-dev.
    - Installation request for friendsofsymfony/rest == 0.8.9999999.9999999-dev -> satisfiable by friendsofsymfony/rest 0.8.x-dev.

Any idea?

n1c01a5 avatar Sep 26 '12 15:09 n1c01a5

are you using the new lock file format or the old one ?

stof avatar Sep 26 '12 15:09 stof

My composer.json:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*",
        "gedmo/doctrine-extensions": "dev-master",
        "friendsofsymfony/user-bundle": "*",
        "friendsofsymfony/comment-bundle": "dev-master",
        "mopa/bootstrap-bundle": "dev-master",
        "twitter/bootstrap": "master",
        "knplabs/knp-paginator-bundle": "dev-master",
        "knplabs/knp-menu-bundle": "dev-master",
        "kriswallsmith/assetic": "dev-master",
        "whiteoctober/breadcrumbs-bundle": "2.1.x-dev",
        "stof/doctrine-extensions-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "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": [
            "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"
    },
    "repositories": [
           {
               "type": "package",
               "package": {
                   "version": "master",
                   "name": "twitter/bootstrap",
                   "source": {
                       "url": "https://github.com/twitter/bootstrap.git",
                       "type": "git",
                       "reference": "master"
                   },
                   "dist": {
                       "url": "https://github.com/twitter/bootstrap/zipball/master",
                       "type": "zip"
                   }
               },
               "type": "vcs",
               "url": "http://github.com/phiamo/assetic"
           }
       ]
}

And my composer.lock

{
    "hash": "bdd18a9e0a005f70f5f26888ceb974a1",
    "packages": [
        {
            "package": "doctrine/common",
            "version": "2.3.x-dev",
            "source-reference": "605b1b8b5a7bc8daf9111fb35483e5708e30de35",
            "commit-date": "1346249247"
        },

        {
            "package": "friendsofsymfony/rest",
            "version": "dev-master",
            "alias-pretty-version": "0.7.x-dev",
            "alias-version": "0.7.9999999.9999999-dev"
        },

//...

        {
            "package": "jms/aop-bundle",
            "version": "1.0.0"
        },
        {
            "package": "jms/cg",
            "version": "1.0.0"
        },
        {
            "package": "jms/di-extra-bundle",
            "version": "1.1.x-dev",
            "source-reference": "af219527024c584d7311aa855d7522429c5bdb67",
            "commit-date": "1346947722"
        },
        {
            "package": "jms/metadata",
            "version": "1.1.1"
        },
        {
            "package": "jms/security-extra-bundle",
            "version": "1.2.x-dev",
            "source-reference": "9ab6aceda50fc7a2b07d741ba4b3f0695508afcb",
            "commit-date": "1346947943"
        },
        {
            "package": "jms/serializer-bundle",
            "version": "dev-master",
            "alias-pretty-version": "0.9.x-dev",
            "alias-version": "0.9.9999999.9999999-dev"
        },
        {
            "package": "jms/serializer-bundle",
            "version": "dev-master",
            "source-reference": "5a9b7e6b62143950726f642da23d7eebf850e389",
            "commit-date": "1346073949"
        },
///...
        {
            "package": "whiteoctober/breadcrumbs-bundle",
            "version": "2.1.x-dev",
            "source-reference": "67ed84215d05bff1d4de22ce16e09bc0a0ae9b40",
            "commit-date": "1345904937"
        }
    ],
    "packages-dev": null,
    "aliases": [

    ],
    "minimum-stability": "dev",
    "stability-flags": {
        "gedmo/doctrine-extensions": 20,
        "friendsofsymfony/comment-bundle": 20,
        "mopa/bootstrap-bundle": 20,
        "knplabs/knp-paginator-bundle": 20,
        "knplabs/knp-menu-bundle": 20,
        "kriswallsmith/assetic": 20,
        "whiteoctober/breadcrumbs-bundle": 20,
        "stof/doctrine-extensions-bundle": 20
    }
}

Any problem?

n1c01a5 avatar Sep 26 '12 15:09 n1c01a5

The reason of your bug when running composer install is that the branch alias has changed in FOSRest after it was locked. This was a known issue in composer which has been resolved with the new format for the lock file (storing much more information about the locked packages).

To solve your issue, run composer self-update to get the latest version and then regenerate your lock file with the new format (using composer update)

stof avatar Sep 26 '12 16:09 stof

I have already run this command but that not solve it?

How I can fix my composer.lock?

This line is very strange "alias-version": "0.7.9999999.9999999-dev".

My "solution": remake the whole installation.

n1c01a5 avatar Sep 26 '12 16:09 n1c01a5

@kristofvc

"jms/serializer-bundle":"dev-master",

doesn't work but

"jms/serializer-bundle":"0.9.0",

works.

devmach avatar Sep 30 '12 04:09 devmach