Reputation: 944
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.
Upvotes: 4
Views: 37718
Reputation: 2262
If you are using a mirror of https://packagist.org/, the mirror might be outdated. You have to swith to a up-to-date mirror or unset the mirror config like this:
composer config -g --unset repos.packagist
However, if you unset the mirror(/switch to the default source), you have to figure out the network connection thing maybe. Enable your VPN/proxy before installing anything with composer.
Upvotes: 2
Reputation: 11951
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
Upvotes: 7