12
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

composer updateでartisanコマンドのエラーが出る時の対処法

Last updated at Posted at 2016-03-16

Laravel4から5.1にアップデートをして、composer updateをする時に下記のようなエラーが出ました。

$ composer update   
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> php artisan clear-compiled

                                            
  [InvalidArgumentException]                
  Command "clear-compiled" is not defined.  
                                            

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

                      
  [RuntimeException]  
  Error Output:       

どうやら、artisanコマンドが動作していないようです。
laravelのgithubリポジトリのconfigをよく見てみると、
5.1のブランチでは、ArtisanServiceProviderがservice providerのところに定義されています。
5.2のものをコピーしたため、これが不足していたようです :sob:

'providers' => [
        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
...

定義を追加すると、無事updateできました。 :relaxed:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> php artisan clear-compiled
> php artisan optimize
Generating optimized class loader
12
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?