当前位置:  开发笔记 > 前端 > 正文

Composer无法执行应用程序/控制台缓存:清除symfony 3

如何解决《Composer无法执行应用程序/控制台缓存:清除symfony3》经验,为你挑选了2个好方法。

我无法运行,composer install因为它在执行post-install-cmd-scripts 时失败了.

原因是Symfony 3将控制台应用程序从app文件夹移动到bin文件夹.

我曾尝试composer clear-cachecomposer self-update,所以我可以确认我运行的是最新版本的作曲家,没有任何运气...谁能帮助我?

结果来自 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

编辑:添加了我的composer.json文件:Pastie

额外的部分:

"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"
    }
}

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测试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.                                            

问题回复:https://bitbucket.org/Richardh87/messenger



1> 小智..:

有同样的问题.发现var目录丢失了.

var目录添加到项目根目录为我解决了这个问题.看起来symfony 3尝试使用旧的项目结构,如果缺少var文件夹.希望这可以帮助别人.



2> 小智..:

尝试

sudo rm -rf vendor/* 

sudo rm -rf composer.lock 

然后运行

composer install 

再次

推荐阅读
Life一切安好
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有