【问题标题】:Laravel Composer Won't Update/InstallLaravel Composer 不会更新/安装
【发布时间】:2014-11-11 00:09:42
【问题描述】:

我最近在一个视图中更改了2行并将代码推送到github。当我在 Laravel Forge 上部署时(大约 2 周没有更新),我收到以下错误:

"error":{
    "type":"ErrorException",
    "message":"Declaration of Illuminate\\View\\Engines\\CompilerEngine::handleViewException() should be compatible with Illuminate\\View\\Engines\\PhpEngine::handleViewException($e)",
    "file":"\/home\/forge\/default\/vendor\/laravel\/framework\/src\/Illuminate\/View\/Engines\/CompilerEngine.php",
    "line":100
}

我什至不能在php artisan -v 没有得到那个错误。然后我运行composer diagnosis 并得到:

Checking composer.json: FAIL
require.damianromanowski/simplecdn : unbound version constraints (dev-master) should be avoided
require.roumen/feed : unbound version constraints (dev-master) should be avoided
require.themonkeys/error-emailer : unbound version constraints (dev-master) should be avoided
require.abodeo/laravel-stripe : unbound version constraints (dev-master) should be avoided
require.mattbrown/laracurl : unbound version constraints (dev-master) should be avoided
require.themonkeys/cachebuster : unbound version constraints (dev-master) should be avoided
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues beyond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK

如何消除该错误?以前从未见过,也不确定是什么问题。

【问题讨论】:

    标签: laravel composer-php


    【解决方案1】:

    解决此问题的正确方法是在运行 composer installcomposer update 之前运行 php artisan clear-compiled

    如果需要,您可以将以下内容添加到“脚本”部分的 composer.json 中,以使其自动化:

    "pre-install-cmd" :[
        "php artisan clear-compiled"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    

    【讨论】:

      【解决方案2】:

      由#laravel 中的AndreasLutro 提供:

      尝试删除 bootstrap/compiled.php。

      这为我解决了问题。

      【讨论】:

        猜你喜欢
        • 2018-08-17
        • 2014-06-28
        • 1970-01-01
        • 1970-01-01
        • 2019-04-05
        • 1970-01-01
        • 2016-06-20
        • 2014-10-27
        • 2016-06-19
        相关资源
        最近更新 更多