laravel/framework[v10.0.0, ..., v10.0.3] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint - php

When trying to install laravel 10, I am getting this error-
laravel/framework[v10.0.0, ..., v10.0.3] require composer-runtime-api
^2.2 -> found composer-runtime-api[2.1.0] but it does not match the
constraint.

To solve the problem, I had to update the composer by running the commands-
composer clearcache
composer selfupdate

Related

I can't install spatie/laravel-sitemap on Laravel 5.6

I'm getting this error when installing:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/laravel-sitemap[5.9.0, ..., 5.9.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 spatie/laravel-sitemap ^5.9 -> satisfiable by spatie/laravel-sitemap[5.9.0, 5.9.1, 5.9.2].
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require spatie/laravel-sitemap:*" to figure
out if any version is installable, or "composer require
spatie/laravel-sitemap:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to
their original content.
you can just
composer require spatie/laravel-sitemap:*
# ^
Composer will figure out if any version (*) is installable (thanks to dependency resolution, compare Dependency Hell etc.).
You can also leave the star (*) out, as it poses some problems in the shell/command interpreter. Example:
composer require spatie/laravel-sitemap
See as well: How to install a specific version of package using Composer?

Why can't I bind Elasticsearch and Laravel Scout?

I decided to test Elasticsearch in conjunction with Laravel Scout. I took this article as a basis
Attempt #1
composer require elasticsearch/elasticsearch - installing ES for Laravel
composer require laravel/scout - installing latest version for Scout (9.1)
composer require tamayo/laravel-scout-elastic - installing package for ES+Scout
I get this error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- tamayo/laravel-scout-elastic[8.0.0, ..., 8.0.2] require laravel/scout ^8.0 -> found laravel/scout[v8.0.0, ..., 8.x-dev] but it conflicts with your root composer.json require (^9.1).
- Root composer.json requires tamayo/laravel-scout-elastic ^8.0 -> satisfiable by tamayo/laravel-scout-elastic[8.0.0, 8.0.1, 8.0.2].
I understand for myself that this bundle package has not been updated on github for six months and it is necessary to get to it the necessary version of laravel/scout, so I change the order of actions and do so:
Attempt #2
composer require elasticsearch/elasticsearch - installing ES for Laravel
composer require tamayo/laravel-scout-elastic - installing this package hoping that he will get the necessary version of laravel/scout for himself as a dependency, in confirmation of this - I see in the console that he pulled up laravel/scout:8.6.1
Now no mistakes, I'm moving on:
I go to config/app.php and add:
Laravel\Scout\ScoutServiceProvider::class,
ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
Run php artisan vendor:publish
And now I get new error:
Class 'ScoutElastic\ScoutElasticServiceProvider' not found
What am I doing wrong?
Solution: don't add ScoutEngines\Elasticsearch\Elastic search Provider:: class, to config/app.php
Everything works fine without adding this provider

Trying to install Cashier on Laravel 5.4.36

I am using Laravel 5.4.36 and I am trying to install Cashier using these steps: https://www.nicesnippets.com/blog/laravel-7-cashier-stripe-subscription-tutorial
However when I try to run this line:
sudo composer require laravel/cashier
I get this error:
Problem 1
- laravel/cashier[v12.6.0, ..., v12.6.1] require illuminate/contracts ^6.0|^7.0|^8.0 -> found illuminate/contra
cts[v6.0.0, ..., v6.20.7, v7.0.0, ..., v7.30.0, v8.0.0, ..., v8.19.0] but these were not loaded, likely because it
conflicts with another require.
- Root composer.json requires laravel/cashier ^12.6 -> satisfiable by laravel/cashier[v12.6.0, v12.6.1].
What am I doing wrong and how do I fix this?
Thanks,
When you do
composer require laravel/cashier
this will install the current version of the cashier package that works with the current version of Laravel. You have to check what version of cashier (if any), your current Laravel version installed, supports.

unisharp/laravel-ckeditor on Laravel 8+ cannot install package

I'm trying to install ckeditor on my Laravel 8+ project, but can't.
I have the errors:
Problem 1:
Root composer.json requires unisharp/laravel-ckeditor 4.7.2 -> satisfiable by unisharp/laravel-ckeditor[4.7.2].
unisharp/laravel-ckeditor 4.7.2 requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev] but it conflicts with another require.
this is the errors
I've tried install version 4.7.2 and 5.0, but that still not working.
Is someone know how to solve this problem?
I had the same problem. The command composer require ckeditor/ckeditor worked for me.
unisharp/laravel-ckeditor has seen it's latest release in Nov 2017, more than three years ago. As the error message tells you: this package is not compatible with current versions of Laravel. Either downgrade Laravel to v5 (not recommended), search for another package providing such functionality, or fork the package to provide the neccessary updates.
To install ckeditor on Laravel 8+ project.
If you already have npm installed then use this line:
$ npm install ckeditor4
Then execute the following command:
$ npm update
i ran in to the same problem using`
composer require unisharp/laravel-ckeditor
then i used
$ composer require ckeditor/ckeditor
and it solved it

Composer require gives errors while installing barryvdh/laravel-dompdf

I'm quite new with Laravel and wrote my first app.
I'm using Laravel 5.4 with PHP 7.1.5 on Windows, but when I run the composer require barryvdh/laravel-dompdf command, I get following issues. I have followed many "possible solutions" but still it is not working.
This is the error:
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- Installation request for barryvdh/laravel-dompdf ^0.8.1 -> satisfiable by barryvdh/laravel-dom
pdf[v0.8.1].
- barryvdh/laravel-dompdf v0.8.1 requires dompdf/dompdf ^0.8 -> satisfiable by dompdf/dompdf[v0.
8.0, v0.8.1, v0.8.2] but these conflict with your requirements or minimum-stability.
Don't composer update. If you have dompdf/dompdf in your composer.json just update it, specifying 0.8.* as version and running
composer update dompdf/dompdf
then
composer require barryvdh/laravel-dompdf
--
Running a generic composer update will affect all your other dependencies you may want keep as they currently are.
All the changes affected by your composer update command are then recorded in your composer.lock file.
When you'll move your project somewhere else or you'll deploy it on a server for example, the composer install command will read the composer.lock file and will install the exact version of your dependencies which are recorded in it. So you'll be sure about the version of your dependencies.
Run this command
composer require barryvdh/laravel-dompdf "^0.8.2" .
Delete your composer.lock file and run:
composer install
Check then dompdf/dompdf may updated e.g. 0.7.* or ~0.7.0
composer update;
composer require barryvdh/laravel-dompdf;

Categories