当前位置:  开发笔记 > 编程语言 > 正文

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

如何解决《脚本phpartisanclear-compiled处理返回的错误前更新-cmd事件(Laravel4.1升级)》经验,为你挑选了4个好方法。

我最近尝试从Laravel 4.0升级到Laravel 4.1,运行php composer.phar update时出现以下错误:

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"
        ]
    },

小智.. 8

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

composer install --no-scripts


user2094178.. 7

你有没有按照升级程序?跑步composer update还不够.laravel.com/docs/upgrade



1> 小智..:

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

composer install --no-scripts



2> user2094178..:

你有没有按照升级程序?跑步composer update还不够.laravel.com/docs/upgrade



3> 小智..:

尝试删除/bootstrap/compiled.php(我在降级Laravel 4.2> 4.1时遇到了麻烦)

然后尝试composer update,它应该工作.

祝好运



4> Duikboot..:

在composer.json中尝试以下操作.有明确的编译处理的预更新CMD事件是你的错误,你可能会清除它.

"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"
    ]
},

尝试再次运行以下命令:

 php composer.phar update

推荐阅读
我我檬檬我我186
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有