donglan8999 2017-11-16 17:17
浏览 298
已采纳

运行composer install时出错执行\“'cache时发生错误:clear --no-warmup'\”命令:

I am trying to boot up a Vagrant machine(with ansible) that is throwing an error when it gets to the task of "composer install". I searched this problem and tried multiple solutions that did not work(explained below).

I believe it has to do with vagrant user not having permission to write to app/cache and app/log even if I change the permission on VM and local. Not sure what the fix would be.

Error:

failed: [default] (item=composer install) => {"changed": true, "cmd": ["composer", "install"], "delta": "0:00:06.144861", "end": "2017-11-16 12:03:03.366269", "failed": true, "item": "composer install", "rc": 1, "start": "2017-11-16 12:02:57.221408", "stderr": "Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files > Incenteev\ParameterHandler\ScriptHandler::buildParameters > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the \"'cache:clear --no-warmup'\" command:
// Clearing the cache for the dev environment with debug true

[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory \"/var/www/fisher.dev/app/cache/de~/annotations\": .

cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] .

Composer.json file:

{
"name": "fostermadeco/fisher",
"license": "proprietary",
"type": "project",
"autoload": {
    "psr-4": {
        "": "src/"
    },
    "classmap": [
        "app/AppKernel.php",
        "app/AppCache.php"
    ]
},
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.11.3",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "snc/redis-bundle": "^2.0",
    "predis/predis": "^1.1",
    "doctrine/doctrine-migrations-bundle": "1.2.1",
    "alcaeus/mongo-php-adapter": "^1.0",
    "doctrine/mongodb-odm": "^1.2",
    "doctrine/mongodb-odm-bundle": "^3.2",
    "ocramius/package-versions": "^1.1",
    "ircmaxell/random-lib": "^1.2",
    "jms/serializer-bundle": "^1.1",
    "nelmio/api-doc-bundle": "^2.13",
    "maba/webpack-bundle": "^0.6.4",
    "stripe/stripe-php": "^4.3",
    "doctrine/annotations": "^1.3",
    "bugsnag/bugsnag-symfony": "^1.0",
    "stof/doctrine-extensions-bundle": "^1.2",
    "danielstjules/stringy": "^2.3",
    "doctrine/migrations": "1.4.1",
    "beberlei/DoctrineExtensions": "1.0.*"
},
"require-dev": {
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "~2.7",
    "doctrine/data-fixtures": "^1.2",
    "hautelook/alice-bundle": "^1.4"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "public",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": null
},
"minimum-stability": "dev"
}
  1. I am able to clear the cache using both 'php app/console cache:clear' and 'php app/console cache:clear --no-warmup'

  2. I am also able to 'rm -rf app/cache/*' and I have changed the permission on the cache folder 'sudo chmod -R 777 app/cache'

  3. I am using ansible which sets the date.timezone='America/New_York'

Any help would be really appreciated! Thanks!

  • 写回答

2条回答 默认 最新

  • dounue1965 2017-11-20 17:10
    关注

    I found that the issue was with my operating system macOS High Sierra v10.13.1. Currently there is a bug with this os and vagrant which has to do with Vagrant's file sync, NFS and the mapping of files on the macOS.

    More info: http://www.qed42.com/blog/macos-sierra-issues-vagrant

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化