Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer fails executing app/console cache:clear on symfony 3

I cant run composer install because it fails when executing the post-install-cmd-scripts.

The reason is Symfony 3 moved the console app from the app folder to a bin folder.

I have tried composer clear-cache and composer self-update, so I can verify that I'm running the latest version of composer without any luck... Can anyone help me?

Results from composer diagnose

composer diagnose
Checking composer.json: FAIL
Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance
require.symfony/symfony : unbound version constraints (dev-master) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

Edit: Added my composer.json file: Pastie

Extra's part:

"extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    }
}

Error from Composer:

Could not open input file: app/console
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception



  [RuntimeException]                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command:  
  Could not open input file: app/console                                     
  .                                                                          

Manuall test of bin/composer cache:clear:

bin/console cache:clear

 // Clearing the cache for the dev environment with debug true


 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.                                            

The problem repo: https://bitbucket.org/Richardh87/messenger

like image 907
Richard87 Avatar asked Dec 17 '15 21:12

Richard87


1 Answers

Had the same problem. Found that var directory was missing.

Adding var directory to project root dir solved this for me. It looks like symfony 3 tries to use old project structure if var folder is missing. Hope this can help someone.

like image 189
overgapo Avatar answered Sep 28 '22 04:09

overgapo