symfonycomposer-phpsymfony-flex

sh: symfony-cmd: command not found


I have downgraded a Symfony 5.2 app template to use Symfony 4.4 in order to allow the use of some libraries that require an older version of Symfony. The problem is that when I do composer install, I get this error near the end of the installation:

sh: symfony-cmd: command not found

It seems that the installations are mostly successful, as my vendor folder is created and populated. But I'm worried about the error.

What does this error mean? How do I fix it?

====

Edit: Here's my composer.json file:

{
    "type": "project",
    "license": "proprietary",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=7.4.0",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "composer/package-versions-deprecated": "1.11.99.1",
        "cweagans/composer-patches": "^1.7",
        "doctrine/doctrine-bundle": "^2.4",
        "doctrine/doctrine-migrations-bundle": "^3.1",
        "doctrine/orm": "^2.9",
        "phpdocumentor/reflection-docblock": "*",
        "sensio/framework-extra-bundle": "*",
        "symfony/framework-bundle": "4.4.*",
        "symfony/http-client": "*",
        "symfony/intl": "*",
        "symfony/mailer": "*",
        "symfony/mime": "*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/notifier": "*",
        "symfony/process": "*",
        "symfony/property-access": "*",
        "symfony/property-info": "*",
        "symfony/proxy-manager-bridge": "*",
        "symfony/security-bundle": "*",
        "symfony/serializer": "*",
        "symfony/string": "*",
        "symfony/translation": "*",
        "symfony/twig-bundle": "*",
        "symfony/validator": "*",
        "symfony/web-link": "*",
        "symfony/yaml": "*",
        "twig/extra-bundle": "*",
        "twig/twig": "*"
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.4",
        "roave/security-advisories": "dev-master",
        "symfony/browser-kit": "*",
        "symfony/css-selector": "*",
        "symfony/debug-bundle": "*",
        "symfony/maker-bundle": "*",
        "symfony/phpunit-bridge": "*",
        "symfony/stopwatch": "*",
        "symfony/var-dumper": "*",
        "symfony/web-profiler-bundle": "*",
        "vimeo/psalm": "^4.9"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*"
    },
    "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": "5.2.*"
        },
        "patches": {
            "symfony/maker-bundle": {
                "Provide flag to force annotation in make entity command": "https://raw.githubusercontent.com/vklux/maker-bundle-force-annotation/master/maker-force-annotation-flag.patch"
            }
        }
    }
}

Solution

  • symfony-cmd is a part of Symfony Flex. Your composer.json does not contain any requirement for Flex, so running composer require symfony/flex might resolve that problem.