Search code examples
phplaravel

Could not find package /laravel/laravel with stability stable


Could not find package /laravel/laravel with stability stable.

So I've got that error when I tried to create new laravel project with the following command:

composer create-project --prefer-dist /laravel/laravel project

And if I try just laravel new project, I get: laravel: command not found

However laravel is installed, and if I move to its installation folder (which is ~/.config/composer/vendor/laravel/installer), and I type:

php laravel new project

Then it works but I get bunch of * suggests installing *. For example:

laravel/framework suggests installing symfony/psr-http-message-bridge (Required to use psr7 bridging features (0.2.*).)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)

And many more.

I'm on Linux Mint Cinnamon 64-bit, and LAMP.


Solution

  • Everything you need is covered in Laravel's extensive documentation.

    Via Composer Create-Project

    Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

    composer create-project --prefer-dist laravel/laravel blog

    Note that there is no preceding slash in laravel/laravel.

    For the installer to work, again you can refer to the documentation:

    Via Laravel Installer

    First, download the Laravel installer using Composer:

    composer global require "laravel/installer" Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.

    Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed:

    laravel new blog

    You can read more about changing your $PATH variable here