I have a Symfony 4.4 codebase, where I need to remove the now deprecated security checker package.
But to simple run composer remove sensiolabs/security-checker
does not properly remove the package.
composer remove sensiolabs/security-checker
./composer.json has been updated
Running composer update sensiolabs/security-checker
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 0 updates, 2 removals
- Removing composer/ca-bundle (1.2.9)
- Removing sensiolabs/security-checker (v5.0.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 0 updates, 2 removals
- Removing sensiolabs/security-checker (v5.0.3)
- Removing composer/ca-bundle (1.2.9)
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 2 recipes (acd31206aa63ca25126df4f0b5f09748)
- Unconfiguring sensiolabs/security-checker (>=4.0): From github.com/symfony/recipes:master
- Unconfiguring composer/ca-bundle (>=1.2.9): From auto-generated recipe
Synchronizing package.json with PHP packages
Don't forget to run npm install --force or yarn install --force to refresh your JavaScript dependencies!
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In AddConsoleCommandPass.php line 53:
!!
!! Class "SensioLabsSecurityCommandSecurityCheckerCommand" used for service
!! "SensioLabsSecurityCommandSecurityCheckerCommand" cannot be found.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd
I cleared (and removed) the cache, and I also reset (removed and reinstalled) the vendors once.
But I always get the SensioLabsSecurityCommandSecurityCheckerCommand not found error.
It seems as some parts remains which is called by the composer.json
@auto-scripts entry?
This is the composer.json
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-bcmath": "*",
"ext-simplexml": "*",
"sensio/framework-extra-bundle": "^5.2",
"symfony/asset": "*",
"symfony/console": "*",
"symfony/expression-language": "*",
"symfony/finder": "*",
"symfony/flex": "^1.2",
"symfony/form": "*",
"symfony/framework-bundle": "*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/security-bundle": "*",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/templating": "*",
"symfony/translation": "*",
"symfony/twig-bundle": "*",
"symfony/validator": "*",
"symfony/webpack-encore-bundle": "^1.6",
"symfony/yaml": "*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0",
"symfony/debug-pack": "*",
"symfony/dotenv": "*",
"symfony/phpunit-bridge": "*",
"symfony/profiler-pack": "^1.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/App/",
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/App/"
}
},
"replace": {
"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.*"
}
}
}
2
Answers
You need to remove it also from the composer.json
"auto-scripts"
section, you probably have something like this:Remove security_checker.yaml from your config files