Search code examples
composer-phpasseticsymfony4

symfony 4.0 failed to install assetic-bundle


I'm trying this new symfony 4.0, so I failed to install assetic-bundle, the command I use

composer require assetic-bundle

I got a set of problems :

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/assetic-bundle v2.8.2 requires symfony/framework-bundle ~2.3|~3.0
-> satisfiable by symfony/framework-bundle[2.3.x-dev, 2.4.x-dev,/....../  v3.4.0-RC2]
but these conflict with your requirements or minimum-stability.

I got four problems like this (I just took the important part of the first because they are very long) my requirements in the json file:

"require": {
    "php": "^7.1.3",
    "sensio/framework-extra-bundle": "^5.1",
    "sensiolabs/security-checker": "^4.1",
    "symfony/asset": "^4.0",
    "symfony/console": "^4.0",
    "symfony/flex": "^1.0",
    "symfony/framework-bundle": "^4.0",
    "symfony/lts": "^4@dev",
    "symfony/profiler-pack": "^1.0",
    "symfony/twig-bundle": "^4.0",
    "symfony/web-server-bundle": "^4.0",
    "symfony/yaml": "^4.0"
},
"require-dev": {
    "symfony/dotenv": "^4.0"
},

hearing from you, thanks ^_^


Solution

  • You can try using sanpi/assetic-bundle.

    It's the same assetic-bundle but implemented by other people right for using in symfony 4. You don't need even to change any namespaces or class names in your Kernel.php or in other code.

    Had the same problem after upgrading from 3.x version and this really helped.