Saturday, January 29, 2022

[FIXED] The requested package symfony/assetic-bundle could not be found in any version

Issue

I'm trying to update Symfony2 from 2.0 to 2.2 (2.2 version is mandatory) but composer install command results in the following error:

  Problem 1
    - The requested package symfony/assetic-bundle could not be found in any version, there may be a typo in the package name.
  Problem 2
    - Installation request for pinroom/pinroom-web 2.2.x-dev -> satisfiable by pinroom/pinroom-web[2.2.x-dev].
    - pinroom/pinroom-web 2.2.x-dev requires symfony/assetic-bundle 2.3.*@dev -> no matching package found.

The composer.json contents:

{
    "name": "pinroom/pinroom-web",
    "description": "Pinroom symfony2 web application",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "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.3.*@dev",
        "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.*",
        "kriswallsmith/assetic": "1.1.*",
        "stof/doctrine-extensions-bundle": "~1.1@dev",
        "predis/predis": "0.*",
        "snc/redis-bundle": "2.1.*@dev",
        "cybernox/amazon-webservices-bundle": ">=1.5.4",
        "gregwar/image-bundle": "dev-master",
        "oldsound/rabbitmq-bundle": "dev-master",
        "friendsofsymfony/elastica-bundle": "~2.0",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/intl-bundle": "dev-master",
        "sonata-project/cache-bundle": "dev-master",
        "sonata-project/user-bundle": "2.2.*@dev",
        "friendsofsymfony/user-bundle": "*",
        "friendsofsymfony/facebook-bundle": "1.1.*"
    },
    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    },
    "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"
        }
    }
}

If I change symfony/assetic-bundle version to "2.1.*", composer install works but install assets fail with this error. I've tried proposed solution in related post but it cause the composer error.

Anyone passed this?

Thanks in advance & sorry for my english.

EDIT

It was by dependencies errors. Finally I'm inmersed in 2.2 - 2.3LTS upgrade.


Solution

you should probably only update to the latest, which is 2.4 or 2.5, its not usually recommended to install an older version. This is up to you. I can only include the changes which i see on my composer.json file which you might want to try.

{
"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.4",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",

    "twbs/bootstrap": "3.1.*",
    "jquery/jquery":  "1.10.*",
    "braincrafted/bootstrap-bundle": "~2.0",
    "knplabs/knp-menu": "2.0.*@dev",
    "knplabs/knp-menu-bundle": "2.0.*@dev",
    "knplabs/knp-paginator-bundle": "dev-master",
    "friendsofsymfony/jsrouting-bundle": "@stable",
    "symfony/icu": "1.1.*",
    "rhumsaa/array_column": "~1.1",
    "webfactory/exceptions-bundle": "@stable"
},
"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",

        "Braincrafted\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::install"
    ],
    "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",

        "Braincrafted\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::install"
    ]
},
"config": {
    "bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.4-dev"
    },

    "symfony-assets-install": "symlink"
},

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery/jquery",
            "version": "1.10.2",
            "dist": {
                "url": "http://code.jquery.com/jquery-1.10.2.js",
                "type": "file"
            }
        }
    }
]

}

If you notice a few things you might want to check and try the following:

1) the name:, i dont know what this is for, but it may be causing the "pinroom" problem.

"name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",

2) the symfony version "symfony/symfony": "~2.4",1

3) the version your indicating for assetic bundle "symfony/assetic-bundle": "~2.3",

4) the minimum stability specified "minimum-stability": "stable",



Answered By - blamb

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.