php composer.phar update failed - A typo in the package name
Asked Answered
J

1

10

I have created a new Symfony 2.1 project and added a custom package downloaded by a SVN repo. Now I'm tryng to upgrade the project to Symfony 2.2, but anytime I try to execute the command php ~/bin/composer.phar update the following error message appears:

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
  - The requested package custom/utils could not be found in any version, there may be a typo in the package name.

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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

This is Symfony 2.2 composer.json:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "svn+ssh://sources.de.ext/usr/local/svnroot/utils"
        }
    ],
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*",
        "custom/utils": "*"
    },
    "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": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}

Custom utils have following composer.json:

{
    "name": "custom/utils",
    "version": "1.0.0",
    "description": "The Custom Libraries",
    "autoload": {
        "psr-0": { 
            "Blogo": "src/",
            "WideImage": "lib/"
        }
    },
    "require": {
        "symfony/console": "2.*",
        "symfony/yaml": "2.*"
    }
}

Could anyone help me to understand what's wrong in new 2.2 Symfony? Because this error message appear only Symfony 2.2 upgrade.

Jiujitsu answered 3/4, 2013 at 23:6 Comment(5)
Try replacing the * in the "custom/utils": "*" line with dev-masterFitly
Thanks, I have tried with "custom/utils": "1.0.0", and received error message: The requested package custom/utils 1.0.0 could not be found.Jiujitsu
1.0.0 may not be a valid version. Most bundles use dev-master as far as I know (I'm fairly new to Symfony though).Fitly
1.0.0 it is a valid version. I have created custom/utils version 1.0.0 package, and composer update was working pretty good before I upgraded to Symfony 2.2 ...Jiujitsu
Then I think you have to add your custom repository: getcomposer.org/doc/04-schema.md#repositories. I'm pretty sure the one you have right now is not valid.Fitly
P
10

Try running composer update --verbose or composer show custom/utils --verbose. Both will show you some output about the loading of your SVN repository. It should indicate which versions are loaded or not.

My guess is that you have a dev-trunk version available, and if you require it it will most likely work. You should not specify version: 1.0.0 in your composer.json, because composer reads the version information from tags/branches in your VCS.

Palmitate answered 3/4, 2013 at 23:33 Comment(2)
I have tried to follow your suggestion, so I have removed the version into "custom/utils" composer.json. Nothing has changed. After I tried to specify "trunk" as version into Symfony 2.2 composer.json. A new error message has appeared: "Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for blogo/utils trunk -> satisfiable by blogo/utils dev-trunk. - Removal request for blogo/utils == 9999999-devJiujitsu
The version is dev-trunk not trunk. Composer prefixes branch names with dev- to clearly identify them as unstable targets (versus tags which do not change over time).Palmitate

© 2022 - 2024 — McMap. All rights reserved.