Error while 'composer require jenssegers/mongodb' adding MongoDB to new Laravel 7 Project - laravel

After fresh installation of laravel 7 project,
C:\xampp\htdocs\blog>composer require jenssegers/mongodb --ignore-platform-reqs
But this is giving an error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- jenssegers/mongodb[v3.8.0, ..., v3.8.2] require illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires jenssegers/mongodb ^3.8 -> satisfiable by jenssegers/mongodb[v3.8.0, v3.8.1, v3.8.2].
Also unintalled old composer and installed latest version of it. But still the same issue

Got the issue: Need to check the laravel version compatibility with jenssegers/Laravel-MongoDB. You can check it here:
https://github.com/jenssegers/Laravel-MongoDB#laravel-version-compatibility
Laravel version Compatibility
Laravel Package
4.2.x 2.0.x
5.0.x 2.1.x
5.1.x 2.2.x or 3.0.x
5.2.x 2.3.x or 3.0.x
5.3.x 3.1.x or 3.2.x
5.4.x 3.2.x
5.5.x 3.3.x
5.6.x 3.4.x
5.7.x 3.4.x
5.8.x 3.5.x
6.x 3.6.x
7.x 3.7.x
8.x 3.8.x
And in cmd i Did like this:
C:\xampp\htdocs\blog> composer require jenssegers/mongodb 3.7
Hope this helps anyone with the same issue

For Laravel 8
composer require jenssegers/mongodb:^3.8 --ignore-platform-reqs

In Laravel 8 it worked like this:
composer require jenssegers/mongodb 3.8.x
the ".x" is important, otherwise it marks the same error in MacOs.

Related

installing maatwebsite/excel with laravel 9 but getting the phpoffice/phpspreadsheet errors

installing maatwebsite/excel with Laravel 9 but getting phpoffice and PHP version issues. I am using PHP 8.1, I downgrade to PHP 8.0 but still doesn't work. Even I enable the gd extention from the php.ini file.
I am installing maatwebsite using below command which is offered by official website
composer require maatwebsite/excel
I found the problem it's happening due to cache problem, we need to update the cache version.
Let me explain it with all steps
Go to the php.ini file and remove ;
before
;extension=gd
after
extension=gd
execute the command to change your cache
composer require psr/simple-cache ^2.0
if the above version is not work for you try it with 1.0 version (optional)
composer require psr/simple-cache ^1.0
Then install maatwebsiteexcel
composer require maatwebsite/excel
It will work like a charm
This will help you
composer require psr/simple-cache:^1.0 maatwebsite/excel
Some time composer require fails on Laravel 9 because of the simple-cache dependency, you will have to specify the psr/simple-cache version as ^1.0 in your composer.json to satisfy the PhpSpreadsheet dependency.
find solution here https://docs.laravel-excel.com/3.1/getting-started/installation.html

Problem with laravel/ui in laravel when updating package while upgrading to the latest version of Laravel

I am currently upgrading from Laravel 5 to 8 although I'm not sure if that is relevant or not. I am running PHP 8 in a docker environment having just upgraded from php 7.3. I have deleted my vendor folder, updated composer.json to run all the latest versions of my packages and run composer install. I am getting the error below:
Problem 1
- Root composer.json requires laravel/ui ^3.3 -> satisfiable by laravel/ui[v3.3.0]
- Conclusion: don't install league/flysystem 2.2.0 (conflict analysis result)
- Conclusion: don't install league/flysystem 1.1.3 (conflict analysis result)
I am confused by the top line. What exactly is it trying to tell me? I am obviously requesting version ^3.3 of the package. Is it telling me how I need to specifiy this in composer.json ([v3.3.0])? I have tried writing it as v3.3.0, 3.3.0 and ^3.3 and always I get the same 'Problem'. I am also getting the 'conflict analysis result' errors for other packages below this although I'll assume for now that these are separate and unrelated issues which I will address after I have resolved this issue. Can anybody suggest how I can go about resolving this issue?
Thanks

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

Composer 2, which some of your plugins seem to be incompatible with

I tried to install extension from the magento market place but I got incompatibility error..
Problem 1
magento/composer-root-update-plugin is locked to version 1.0.0 and an update of this package was not requested.
magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and an update of this package was not requested.
dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 3
laminas/laminas-dependency-plugin 1.0.4 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
magento/product-community-edition 2.4.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.4].
magento/product-community-edition is locked to version 2.4.1 and an update of this package was not requested.
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
how do I resolve this?
You can downgrade your Composer to version 1.x
composer self-update --1
And if you need to switch back to Composer version 2.x, you can just type
composer self-update --2
Magento 2.x is not yet compatible with composer 2.x
You can either:
downgrade your system version of Composer to 1.x
download composer 1.x phar file and run local version (preferable)
https://getcomposer.org/download/
Current version is 1.10.19
then run the command using the local composer version:
php ./composer.phar install
Magento does not support Composer 2.x. please ref the link:https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html may help you

league/flysystem-aws-s3-v3 on Laravel 8 other packages require lower version

When running composer require league/flysystem-aws-s3-v3 I get:
league/flysystem-aws-s3-v3[2.0.0, ..., 2.x-dev] require league/flysystem ^2.0.0 -> found league/flysystem[2.0.0-alpha.1, ..., 2.x-dev] but the package is fixed to 1.1.3 (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.
In my composer.json there is no mention of league/flysystem, but it does appear in my composer.lock as "league/flysystem": "^1.1",. It looks like I have a few packages (like spatie/laravel-backup) that have this as an dependancy.
How do I proceed? I'm not sure how to update a package that other packages have as an dependancy, and that these other packages have also fixed to a specific version.
As you've found already: spatie/laravel-backup is not yet compatible with league/flysystem v2 (which is pretty new, it got released... yesterday!).
Simply require the "old" version of that AWS package through composer require league/flysystem-aws-s3-v3:"^1.0".
After all, this is not a problem of Laravel itself.
I am using the latest version of laravel V8.4.0 (JULY 2021)
I solve this by:
Deleting composer.lock in the root folder of the project
running composer require league/flysystem-aws-s3-v3:"~1.0"
For Laravel 8 use
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
It is a problem with Laravel. Laravel v8 does not support league/flysystem v2 yet. v9 will be shipped with a support for it: https://github.com/laravel/framework/pull/33612
For those on Laravel 9, you'll need to upgrade to v3.0 instead.
composer require -W league/flysystem-aws-s3-v3 "^3.0"
After deleting compose.lock

Resources