脚本 php artisan clear 编译处理更新前的 cmd 事件返回错误(Laravel 4.1 升级)

2022-08-30 20:36:11

我最近尝试从Laravel 4.0升级到Laravel 4.1,并且在运行php composer.phar更新时收到以下错误:

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-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

我只要求:

"require": {
        "laravel/framework": "4.1.*",
        "way/generators": "2.*",
        "madewithlove/laravel-oauth2": "0.4.*"
    },

另外,我在错误之前收到了这个(即使我在我的环境中运行php 5.4.10):

phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
phpseclib/phpseclib suggests installing pear-pear/PHP_Compat (Install PHP_Compat to get phpseclib working on PHP < 4.3.3.)
d11wtq/boris suggests installing ext-readline (*)
d11wtq/boris suggests installing ext-pcntl (*)
Writing lock file
Generating autoload files

编辑:

在 composer.json 中使用的脚本:

"scripts": {
        "pre-install-cmd": [
            "php artisan clear-compiled"
        ],
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },

答案 1

也许你可以试试这个命令:

composer install --no-scripts

答案 2

您是否遵循了升级过程?跑步是不够的。laravel.com/docs/upgradecomposer update


推荐