Composer update会抛出错误

时间:2016-05-13 07:55:38

标签: php laravel composer-php

Helllo,

当我尝试使用composer update更新项目时,收到此错误:

> php artisan clear-compiled


  [Symfony\Component\Debug\Exception\FatalErrorException]  
  parse error                                              


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


  [RuntimeException]  
  Error Output:       

当我尝试这个时:

composer update --no-scripts


Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

成功了吗?

这里可能有什么问题?

- 编辑 -

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

1 个答案:

答案 0 :(得分:1)

将php artisan clear-compiled从“pre-update-cmd”移动到composer.json文件中的“post-update-cmd”

"post-update-cmd": [
  "php artisan clear-compiled",
  "php artisan optimize"
]