Mike Rockétt
Mike Rockétt

Reputation: 9007

Unable to update Laravel 4 with Composer (Update: bug?)

Today, I pulled down the laravel/laravel repository from Github. I then ran php composer.phar install (as I normally would on my system, with a command window in the project directory). However, when I ran php composer.phar update, I received this error:

composer.phar could not find file: artisan

Everything installed just fine, and Laravel works as it should.

Any ideas what could be causing this issue?

Edit 1

artisan exists in the root of the project, but it throws an exception when I attempt to run php artisan optimize:

PHP Exception

Side Note 1

If I try the alternative method (quicker) of installing Laravel (php composer.phar create-project laravel/laravel), I get the following:

Create Project Fail

Edit 2

Upon installation, I also get the same error, where it claims it cannot find artisan. Therefore, the installation does not fully complete. I believe that it is stopping when it wants to compile classes (or something to that effect), and then write bootstrap/compiled.php. That file doesn't exist.

Here's the snap from the install:

Install Fail

Edit 3

It seems that Composer is looking for artisan in the drive root (C:\). Why is it doing this? Even if I specify -d on the update, it throws the error. (I picked this up from a hunch - simply copied artisan to the root of the drive and it found it - albeit, it obviously did not run...)

Upvotes: 1

Views: 4589

Answers (3)

Mike Rockétt
Mike Rockétt

Reputation: 9007

Solution Found:

Composer makes calls to php artisan <command> (as per the instruction in composer.json > scripts), but it does not see what directory it is running from (perhaps because it is an external command?).

So, I solved my initial problem by using an absolute path to artisan in composer.json.

Everything is working now. I just wish I knew how to get Composer to know that it is running from C:\LocalServer\lab\laravel, and not just C:\.

Upvotes: 1

edwin
edwin

Reputation: 1

I had this problem today too. My laravel folder inside the vendor was deleted after composer update. I ran composer install again and problem resolved.

Upvotes: 0

raul
raul

Reputation: 11

As i can see, your artisan file is missing. Can you post the exact steps on how you install it ? Also, please follow http://laravel.com/docs/installation and http://niallobrien.me/2013/03/installing-and-updating-laravel-4/

Upvotes: 0

Related Questions