Skip to content
Advertisement

Laravel globally installs 4.1.1 instead of 8.0.1

I am trying to install laravel 8 globally but it is installing version 4.1.1 every time. I use this code:

composer global require laravel/installer

Then i check version by writing this:

laravel -V

How can i install the latest version?

Note: it only happens when i install it globally

Advertisement

Answer

When you run composer global require laravel/installer it installs the Laravel Installer globally. The installers latest release is 4.1.1 – see Github releases

To create a new Laravel 8 project you need to run

$ laravel new example-app

after you installed the installer. Find these steps in the Laravel docs.

Determine the version

Option 1

Run php artisan --version in your folder where you installed your project.

Option 2

After you created your project you can go into the folder where you installed it, f. ex. example-app, and chech the file composer.json.

There you can find a require section with the packages laravel/framework telling you the correct version.

{
    // ... other stuff

    "require": {
        // ... other packages
        "laravel/framework": "^8.12",

    }
}

You probably need to familiarize yourself with Composer and how package management works.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement