简体   繁体   中英

Can't install symfony/maker-bundle

I am new to Symfony, I tried to install symfony/maker-bundle , but it gives me the following error:

Using version ^1.22 for symfony/maker-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - ocramius/proxy-manager 2.9.0 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - Installation request for ocramius/proxy-manager (locked at 2.9.0) -> satisfiable by 
ocramius/proxy-manager[2.9.0].

I searched for similar problems, and often they change a package version in composer.json as the solution, but I can't find neither ocramius/proxy-manager nor composer-runtime-api in it:

{
"type": "project",
"license": "proprietary",
"require": {
    "php": "^7.1.3",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "ext-simplexml": "*",
    "bluetel-solutions/twig-truncate-extension": "^0.1.3",
    "friendsofsymfony/rest-bundle": "^2.7",
    "jms/serializer-bundle": "^3.5",
    "liip/imagine-bundle": "^2.2",
    "sensio/framework-extra-bundle": "^5.4",
    "symfony/apache-pack": "^1.0",
    "symfony/asset": "4.4.*",
    "symfony/console": "4.4.*",
    "symfony/dotenv": "4.4.*",
    "symfony/flex": "^1.3",
    "symfony/form": "4.4.*",
    "symfony/framework-bundle": "4.4.*",
    "symfony/mailer": "4.4.*",
    "symfony/monolog-bundle": "^3.4",
    "symfony/orm-pack": "^1.0",
    "symfony/security-bundle": "4.4.*",
    "symfony/security-csrf": "4.4.*",
    "symfony/serializer": "4.4.*",
    "symfony/swiftmailer-bundle": "^3.4",
    "symfony/translation": "4.4.*",
    "symfony/twig-bundle": "4.4.*",
    "symfony/validator": "4.4.*",
    "symfony/webpack-encore-bundle": "^1.7",
    "symfony/yaml": "4.4.*",
    "twig/extensions": "^1.5",
    "vich/uploader-bundle": "^1.12",
    "whatwedo/core-bundle": "dev-symfony5",
    "whatwedo/search-bundle": "dev-symfony5"
},
"require-dev": {
    "symfony/maker-bundle": "^1.12",
    "symfony/web-server-bundle": "4.4.*"
},
"config": {
    "preferred-install": {
        "*": "dist"
    },
    "sort-packages": true
},
"autoload": {
    "psr-4": {
        "App\\": "src/"
    }
},
"autoload-dev": {
    "psr-4": {
        "App\\Tests\\": "tests/"
    }
},
"replace": {
    "paragonie/random_compat": "2.*",
    "symfony/polyfill-ctype": "*",
    "symfony/polyfill-iconv": "*",
    "symfony/polyfill-php71": "*",
    "symfony/polyfill-php70": "*",
    "symfony/polyfill-php56": "*"
},
"scripts": {
    "auto-scripts": {
        "cache:clear": "symfony-cmd",
        "assets:install %PUBLIC_DIR%": "symfony-cmd"
    },
    "post-install-cmd": [
        "@auto-scripts"
    ],
    "post-update-cmd": [
        "@auto-scripts"
    ]
},
"conflict": {
    "symfony/symfony": "*"
},
"extra": {
    "symfony": {
        "allow-contrib": false,
        "require": "4.4.*"
    }
}

May be I need an other version of symfony/maker-bundle ?

Ocramius is well known for his harsh stance in maintaining backward compatibility.

On this case, release 2.9.0 says:

This release upgrades ocramius/proxy-manager to use composer-runtime-api:^2 : this means that you will need composer:^2 to install this version of ProxyManager.

In order to upgrade to composer v2, you can run composer self-update --2 on your development or CI/CD system.

So your options are:

  • either upgrade composer to version 2 ( composer self-update --2 ), which is really the recommended way to go unless you have some specific composer plugin that you really need and hasn't been updated to account for the new release.

  • Find which package you are installing is the one that requires the proxy-manager ( composer why ocramius/proxy-manager ), and see if you can adjust your version constraints on that package so that it depends on an older (< 2.9) version of ocramius/proxy-manager . (I mention this option only for completeness sake, but upgrading composer is really the way to go).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM