我最近尝试从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
也许你可以尝试这个命令:
composer install --no-scripts
你有没有按照升级程序?跑步composer update
还不够.laravel.com/docs/upgrade
尝试删除/bootstrap/compiled.php(我在降级Laravel 4.2> 4.1时遇到了麻烦)
然后尝试composer update
,它应该工作.
祝好运
在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