4
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.

Scarass
  • 914
  • 1
  • 12
  • 32
  • 1
    There shouldn't be an extra slash in `/laravel/laravel`. It should just be `composer create-project --prefer-dist laravel/laravel project`. You also need to add your global composer packages location to your $PATH environment variable in order to use them. – maiorano84 Dec 27 '16 at 17:34
  • Okay, just managed to create project with composer create-project --prefer-dist laravel/laravel project. Can you tell me where are composer global packages? Are all in ~/config/composer/vendor/bin? But if I run it from there I stll must use: "php laravel". But I should be able just "laravel", right? – Scarass Dec 27 '16 at 17:45
  • Not without adding it to your $PATH variable, you're not. You can find out where your global packages are by running `composer config --list --global`. You can also find out if you installed the package globally by running `composer global show` and seeing if `laravel/installer` is listed. If not, you didn't install it properly. If it is, then [read this to see how to add the appropriate path](http://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your). Also, [read the documentation](https://laravel.com/docs/5.3/installation) – maiorano84 Dec 27 '16 at 17:58

1 Answers1

6

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

Community
  • 1
  • 1
maiorano84
  • 11,574
  • 3
  • 35
  • 48