脚本php手工清理编译处理预更新cmd事件返回错误


Script php artisan clear-compiled handling the pre-update-cmd event returned with an error

在运行composer更新后,我一直收到这个错误

./composer.json has been updated
> php artisan clear-compiled
  [Symfony'Component'Debug'Exception'FatalErrorException]
  Class 'Illuminate'Html'HtmlServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
  [RuntimeException]
  Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-
progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
 [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--pre
fer-lowest] [packages1] ... [packagesN]

在composer.json中,这是我的需求部分:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "laravelcollective/html": "dev-master"    
},

到底是什么问题?

你能发布整个composer.json文件吗?

它应该包含这样的内容:

pre-update-cmd: [

]

在该数组中,有一些命令或脚本正在抛出异常。Composer允许您在应用程序中安装或更新所有Composer包的过程中,在不同的点使用钩子运行脚本。https://getcomposer.org/doc/articles/scripts.md

看起来你还需要将此添加到你的需求部分:

"illuminate/html": "~5.0"

如果您打算在模板中使用Html,请不要忘记添加它的Façade/别名。

提供程序阵列中的config/app.php

'Form'      => Illuminate'Html'FormFacade::class
'Html'      => Illuminate'Html'HtmlFacade::class,