laravel new blog not work mockery/mockery 1.4.0 - laravel

Today I wanted to create a new project with Laravel with this command
laravel new blog
But I get this error
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for mockery/mockery 1.4.0 -> satisfiable by mockery/mockery[1.4.0].
- mockery/mockery 1.4.0 requires php ^7.3.0 -> your PHP version (7.2.23) does not satisfy that requirement.
Why should php7.3 be read when Laravel himself says at least php7.2.5 ???

Run composer update.
The reason:
Your PHP version is too low. You've got 7.2.23 installed, and mockery/mockery 1.4 requires 7.3.0
The best solution is to upgrade your PHP version. Alternatively, you can reduce mockery's version to 1.3.1, which only requires PHP 5.6 or above.
My bug report can be found here
As of 2020-05-21, the zip files that laravel new ___ uses will try to install mockery/mockery version 1.4. This won't work with versions of PHP below 7.3. In order to fix this, run composer update, and mockery will be downgraded to a compatible version.

I had the same problem today for new Laravel projects. The composer.json file was showing "mockery/mockery": "^1.3.1" but still was showing the same error. Delete also the composer.lock file and run composer install.

Assuming you are trying to create a new laravel project called blog this is what I did to fix the error after running laravel new blog
cd into blog
run composer update
Create a .env file. You can just make a copy of .env.example and rename the copy to .env. In case you try to start the dev server using php artisan serve and the app launches with a 500 error, run these commands:
php artisan key:generate
php artisan cache:clear
php artisan config:clear
composer dump-autoload

I had the problem when trying to create new Laravel applications,I updated php version using the following commands and it worked.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install -y php7.4 php7.4-gd php7.4-mbstring php7.4-xml

Delete the composer.lock file and run composer again
composer install

You can just run
composer create-project --prefer-dist laravel/laravel <project_name>
It'll automatically fall-back to mockery^1.3.1

I also faced these problems.
Problem 1
- Installation request for facade/ignition-contracts 1.0.2 -> satisfiable by facade/ignition-contracts[1.0.2].
- facade/ignition-contracts 1.0.2 requires php ^7.3|^8.0 -> your PHP version (7.2.34) does not satisfy that requirement.
Problem 2
- Installation request for mockery/mockery 1.4.2 -> satisfiable by mockery/mockery[1.4.2].
- mockery/mockery 1.4.2 requires php ^7.3 || ^8.0 -> your PHP version (7.2.34) does not satisfy that requirement.
Problem 3
- facade/ignition-contracts 1.0.2 requires php ^7.3|^8.0 -> your PHP version (7.2.34) does not satisfy that requirement.
- nunomaduro/collision v4.2.0 requires facade/ignition-contracts ^1.0 -> satisfiable by facade/ignition-contracts[1.0.2].
- Installation request for nunomaduro/collision v4.2.0 -> satisfiable by nunomaduro/collision[v4.2.0].
I had deleted the composer.lock file and executed composer install command.
My problem solved.

This might be stale, the issue here is that the php needs to be updated to version that will be compatible.
delete the composer.lock file and autoload file in vendor i.e vendor/autoload in your project
upgrade php version from php.net
run composer install --no scripts
run composer update
php artisan migrate
php artisan key:generate

Related

Why haven't install predis on laravel 8

According laravel manual https://laravel.com/docs/8.x/redis for install predis, need run: composer require predis/predis. When that command is running (for laravel 8) - appear next Error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- facade/ignition is locked to version 2.4.2 and an update of this package was not requested.
- facade/ignition 2.4.2 requires php ^7.2.5 -> your php version (8.0.0) does not satisfy that requirement.
Problem 2
- facade/ignition-contracts 1.0.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
- nunomaduro/collision v4.3.0 requires facade/ignition-contracts ^1.0 -> satisfiable by facade/ignition-contracts[1.0.1].
- nunomaduro/collision is locked to version v4.3.0 and an update of this package was not requested.
In my composer.json: "php": "^7.2.5|^8.0",
What here is wrong))?
You need to update facade/ignition and nunomaduro/collision first to support PHP 8 in your project.
Running the following commands should update them accordingly.
composer require --dev facade/ignition nunomaduro/collision
composer require predis/predis
i run comand: composer require --dev facade/ignition nunomaduro/collision and have got new Error: Your requirements could not be resolved to an installable set of packages.
Problem 1
- facade/ignition[2.10.0, ..., 2.10.2] require facade/ignition-contracts ^1.0.2 -> found facade/ignition-contracts[1.0.2] but the package is fixed to 1.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires facade/ignition ^2.10 -> satisfiable by facade/ignition[2.10.0, 2.10.1, 2.10.2].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I have new laravel 8 project (blog) && use new Vagrant Homestead (with all updates) && i use laravel 8 manual)) may be laravel developers is a little busy and is a little tired to give full instruction in manual). I think may be for Laravel8 Homestead allready is not suitable and need Docker and Sail... But project work (with the exception of predis) Now i use phpredis. May be will try use docker... As for Vagrant&&Homestead - https://laravel.com/docs/8.x/homestead#introduction i don't understand what is problem to use that technology .... god with they)...

Why i cannot install Laravel Breeze

I installed a fresh laravel application using version 7.30.4. When I tried to install laravel breeze, using command composer require laravel/breeze --dev, it gives me this error.
[InvalidArgumentException]
Package laravel/breeze has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version
My current version of PHP is 7.2.19
This error comes due to compatible version in your composer.json file. To fix this issue, change the composer.json file "platform" configuration:
"platform": {
"php": "7.3"
}
Then execute composer install or composer update
or you can run the below command:
composer config platform.php 7.4.3
Laravel breeze required PHP version 7.3 and as you said your PHP version is 7.2.19 so you have to update it.

How to install lower version of laravel?

trying to install new laravel app I got version error :
$ laravel new hostels3
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for mockery/mockery 1.4.1 -> satisfiable by mockery/mockery[1.4.1].
- mockery/mockery 1.4.1 requires php ^7.3 || ^8.0 -> your PHP version (7.2.24) does not satisfy that requirement.
I do not want to move to PHP 7.3 now and if there isa a way to install lower version of laravel
to satisfy my PHP version 7.2.24 ? If yes, how ?
Thanks!
Laravel installer needs PHP 7.3, You may use composer instead:
composer create-project --prefer-dist laravel/laravel hostels3
Note 1: Laravel framework v7.x needs PHP version 7.2.5 or greater. You have 7.2.24 so you can install Laravel 7.x (the latest as of writing).
Note 2: To install older version of Laravel, specify the version as the last argument:
composer create-project --prefer-dist laravel/laravel hostels3 "6.*"
that way you can choose the version to install
composer create-project laravel/laravel miproyecto "6.*"
using composer you can simply install, Below I show laravel 5.4 install using composer
composer create-project --prefer-dist laravel/laravel blog "5.4.*"

Laravel Socialite can't be installed in upgraded version 5.6

I have upgraded the laravel from 5.5 to 5.6 and try to install laravel/socialite but there is error.
Composer.json
I think the autoloader is jammed up and needs to be cleared.
Try running
composer dump-autoload
php artisan clear-compiled
composer require laravel/socialite
Looks like you need to install the version ^3.2.0 for the package if you are using laravel 5.6, not the ^3.0 or ^4.0 so, you need to be explicit about the version:
composer require laravel/socialite "^3.2.0"
Docs: https://laravel.com/docs/5.6/socialite#installation

Composer error - Your requirements could not be resolved - Laravel 4.2 on Mediatemple

I'm getting a problem reported from composer when running php -d allow_url_fopen=On composer.phar install on mediatemple.
This reports back saying laravel/framework v4.2.6 requires php >=5.4.0 -> no matching package found.
I've updated my php version to be 5.5, but i'm not sure if the above problem is referring to my php version or the laravel/framework package when it says "no matching package found".
when I run the above command, it shows that it is 'installing dependencies (including require-dev)' but i get the problem reported above.
my minimum stability is set to "stable"
could someone help clarify?
It turns out I was using php v5.3 on the CLI while I was running php 5.5 on the domain successfully as they had told me.
In order to use the latest php version on the CLI, i had to run php-latest composer.phar install instead of php composer.phar install
I found this link helpful: https://yesdevnull.net/2014/03/using-php-54-cli-on-media-temples-grid-hosting/

Resources