1
votes

I'm upgrading a Symfony project from 3.4 to 4.4.8. The Sensio Distribution Bundle is replaced by Flex, so I updated the scripts section of composer.json this way :

"scripts": {
    "auto-scripts": {
        "cache:clear": "symfony-cmd",
        "assets:install %PUBLIC_DIR%": "symfony-cmd"
    },
    "post-install-cmd": [
        "@auto-scripts"
    ],
    "post-update-cmd": [
        "@auto-scripts"
    ]
},

When I run a composer update, composer warns that the commands were skipped :

Skipping "cache:clear" (needs symfony/console to run).

Skipping "assets:install public" (needs symfony/console to run).

Looking at composer.lock, symfony/console isn't installed, as symfony/symfony replaces symfony/console. Running a composer req cli doesn't help. I have no problem running symfony console commands (internal and custom) from the shell

I'm running latest stable version of composer (1.10.6). Is there somehting that I am missing ?

1
Upgrading major versions of Symfony can be tricky as some of the composer philosophy typically changes. I would suggest creating a new 4.4 project, adding in your third party bundles and use the resulting composer.json file as a reference. - Cerad
I'll probably resort to this as last option, as the project is pretty large, but I'm tempted nevertheless to have a full "symfony 4.4 native" architecture - Ashygan
Just to be clear, I am not explicitly recommending refactoring the entire project. Just generating a new composer.json file. - Cerad

1 Answers

0
votes

That error message shows you that you are missing the "symfony/console" library.

Add it with:

composer require symfony/console