Could not find package /laravel/laravel with stability stable - php

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.

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

Related

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

unable to install Laravel via composer on Windows 7: "29 packages you are using are looking for funding"

I have installed Composer on windows 7 with the Composer-Setup.exe.
I am trying to install Laravel via Composer on Windows 7. I've tried 2 different commands:
composer global require laravel/installer
and
composer create-project laravel/laravel blog --prefer-dist
but they don't work.
In the end, there always a message: "29 packages you are using are looking for funding"
When I type composer fund to find out, it says that:
Composer could not find a composer.json file in C:\Users\Administrators
Does any one have any solution or any useful link?
Your composer.json file have some packages which have paid licence. However composer do not prevent installing Laravel due to this.
As per logs Laravel has been successfully installed. Can you check at the destination folder.

Composer can't install laravel

I got this issue when I've tried to install Laravel !!
composer create-project --prefer-dist laravel/laravel blog
[Composer\Downloader\TransportException]
The "http://packagist.org/p/provider-2017-04%24cc0b63f9292683fc4f978a14aca71a0c07b2025b938e199310663bcc64ced957.json" file could not be downloaded (HTTP/1.1 404 No
t Found)
If you all care is to just get a running Laravel without getting in too much deep that how it get installed, I would suggest you choose another way which does the same thing i.e use Laravel Installer instead of composer.
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
More info:
https://laravel.com/docs/master

Composer installation order

Is it possible to set the installation order?
Currently I'm using Doctrine module that requires ext-mongo to be installed, but as I'm using the newer php version (7.0) I have mongodb installed instead. There's a alcaeus/mongo-php-adapter package that resolves installation problems. But there's one problem - Composer is trying to install Doctrine modules first, so that installation fails.
Currently I have to resolve this problem manually, but I can't do it any more as I'm going to pack my environment to a Docker image to let it be automatically deployed later.
From the docs of alcaeus/mongo-php-adapter
"
$ composer require alcaeus/mongo-php-adapter
If your project already has a dependency on ext-mongo, the command above may not work. This is due to a bug in composer, see https://github.com/composer/composer/issues/5030
To fix this, you can use the --ignore-platform-reqs switch when running the above command, or when running composer update with no composer.lock file present."

CakePHP install with Composer version 3.1.*

My problem is that not all server run PHP 5.6 or above.
So I need use a older version of CakePHP 3.1.* that support PHP 5.5.*/5.4.* .
The problem is the Composer install solution:
composer create-project --prefer-dist cakephp/app:3.1.9 demo
Gives me an error:
Could not find package cakephp/app with version 3.1.9
I have tried other version (3.1.11/12/10) without success.
Is there a way or do I need to download the releases manually from GitHub every time?
cakephp/app is a different repository from cakephp/cakephp. So it follows it's own versioning.
cakephp/app is a template/skeleton that you can use to create your app. While cakephp/cakephp is the main core.
Check below for the cakephp/app:
https://github.com/cakephp/app
https://github.com/cakephp/app/releases
I guess you could use the version 3.1.2 of cakephp/app that allows you to have PHP >= 5.4
https://github.com/cakephp/app/blob/3.1.2/composer.json#L8

Categories