Praditha
Praditha

Reputation: 1172

Cannot Install Laravel 5.1 via composer

Start from tommorow, I don't know why I can't install the laravel 5.1 via composer create project. Here is the error. Composer create project Laravel 5.1 Error

At first I thought there is a problem with the composer, but when I tried to install Laravel 5.2, it's successfully created.

Update: After I run the composer create-project, the vendor folder is not created.

Please help me to fix this issue. Thanks.

Upvotes: 1

Views: 2362

Answers (3)

Jamer A. Mesa
Jamer A. Mesa

Reputation: 11

This is a composer problem. Install laravel with:

composer create-project --prefer-dist laravel/laravel blog "5.1.*"

Now, in your composer.json installed, remove this:

    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],

So, in your terminal update composer with this:

composer update --prefer-dist

This work for me.

Upvotes: 1

James
James

Reputation: 16339

I've been running in to this issue lately when creating new instances of my Laravel 5.1 projects.

From what I can piece together it is causing an issue when running the php artisan clear-compiled command as past of the install script.

To get around this I have been running my initial install with the --no-scripts option.

It looks like this is available when creating a project too, so try running the below when installing Laravel 5.1 initially:

composer create-project laravel/laravel blog "5.1.*" --no-scripts

Upvotes: 2

Drudge Rajen
Drudge Rajen

Reputation: 7987

Please run

composer update --prefer-dist

As per the comment and viewing the yellow message in the screen,Please try

sudo composer create-project laravel/laravel blog "5.1.*"

Upvotes: 1

Related Questions