Problem with installing a Laravel package using composer - laravel

I want to using a package in my project.
Composer.json:
"require": {
"php": "^7.2.5|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"hekmatinasser/verta": "^1.11",
"laravel/framework": "^7.29",
"laravel/passport": "^9.3",
"laravel/tinker": "^2.5",
"lcobucci/jwt": "3.3.3",
"pishran/zarinpal": "^2.2"
},
My target package to install :
composer require ipecompany/smsirlaravel
Problem : When I try this on composer, I see follwing error
Problem 1
- ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.2
.0 (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 ipecompany/smsirlaravel ^1.0 -> satisfiable by ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7].
I tried :
composer require ipecompany/smsirlaravel -W
But the main problem is Laravel Passport maybe because of following error :
Problem 1
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.
I tried to install laminas/laminas-diactoros ^2.2 but I got another error
problem 1
- Root composer.json requires laminas/laminas-diactoros 2.2, found laminas/laminas-diactoros[2.2.0] but it conflicts with another require.
Problem 2
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.
Any body can help me to install this package? TNX

As written in the first error message: ipecompany/smsirlaravel requires v6 of Guzzle, but currently v7 is installed. You should use a different version constraint for Guzzle first: change "guzzlehttp/guzzle": "^6.3.1|^7.0.1" to "guzzlehttp/guzzle": "^6.3.1". Afterwards, run composer update guzzlehttp/guzzle such that Guzzle v6 is installed.
Afterwards, running composer require ipecompany/smsirlaravel should work

Related

Problem with laravel/ui while installing laravel-dompdf laravel8

Can someone help me to fix it?
while installing
composer require barryvdh/laravel-dompdf
Errors
Problem 1
- laravel/ui is locked to version v2.3.0 and an update of this package was not requested.
Problem 2
- nette/schema v1.2.1 requires php >=7.1 <8.1 -> your php version (8.1.6) does not satisfy that requirement.
- league/commonmark 2.0.2 requires league/config ^1.1.1 -> satisfiable by league/config[v1.1.1].
- laravel/framework v8.61.0 requires league/commonmark ^1.3|^2.0 -> satisfiable by league/commonmark[2.0.2].
- league/config v1.1.1 requires nette/schema ^1.2 -> satisfiable by nette/schema[v1.2.1].
- laravel/framework is locked to version v8.61.0 and an update of this package was not requested.
composer.json
"require": {
....
"php": "^7.3|^8.0",
"laravel/framework": "^8.54",
"laravel/ui": "^2.0",
"laravelcollective/html": "^6.1",
"livewire/livewire": "^2.5",
"maatwebsite/excel": "^3.1",
....
},
composer require barryvdh/laravel-dompdf

ovh/ovh requires guzzlehttp^6.0 while therobfonz/laravel-mandrill-driver requires guzzlehttp^7.0: is there any solution?

In my Laravel 8 project I had to install the mailer therobfonz/laravel-mandrill-driver; now I have to install the SMS driver ovh/ovh.
For the moment in my composer.json file I have:
"guzzlehttp/guzzle": "^7.0",
"therobfonz/laravel-mandrill-driver": "^3.0"
When I type: composer require ovh/ovh, I have this error:
ovh/ovh v2.1.0 requires guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.0).
I have tried to edit composer.json by changing the version of guzzle to "^6.0", then doing composer update. However this results in an error (mandrill requires guzzle ^7.0).
What could I do?
OVH v3.0.0 works with Guzzle 7.0
https://github.com/ovh/php-ovh/blob/75852ad0fee8008b6245d72a7d3ba7f09cb456ae/composer.json
Maybe you should just update OVH?

I got de error when I tried install composer league/flysystem-aws-s3-v3

I got de error when I tried install composer league/flysystem-aws-s3-v3
My line: composer require league/flysystem-aws-s3-v3
I using Laravel 8 and php 7.3
I also tested removing composer.lock
Someone already fixed it?
Your requirements could not be resolved to an installable set of packages.
Problem 1
- 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.
- league/flysystem-aws-s3-v3[2.0.0-alpha.1, ..., 2.0.0-alpha.2] require league/flysystem 2.0.0-alpha.1 -> found league/flysystem[2.0.0-alpha.1] 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.
- league/flysystem-aws-s3-v3[2.0.0-alpha.4, ..., 2.0.0-beta.1] require league/flysystem 2.0.0-alpha.3 -> found league/flysystem[2.0.0-alpha.3] 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.
- league/flysystem-aws-s3-v3[2.0.0-beta.2, ..., 2.0.0-beta.3] require league/flysystem ^2.0.0-beta.1 -> found league/flysystem[2.0.0-beta.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.
- league/flysystem-aws-s3-v3 2.0.0-RC1 requires league/flysystem ^2.0.0-RC1 -> found league/flysystem[2.0.0-RC1, 2.0.0, 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.
- Root composer.json requires league/flysystem-aws-s3-v3 ^2.0 -> satisfiable by league/flysystem-aws-s3-v3[2.0.0-alpha.1, ..., 2.x-dev].
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.
My composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3",
"aws/aws-sdk-php": "^3.166",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.17",
"laravel/tinker": "^2.0",
"tymon/jwt-auth": "^1.0"
},
...
I have faced the same problem. I tried this and it's helpful
composer require league/flysystem-aws-s3-v3 ~1.0
You could try
composer require league/flysystem-aws-s3-v3 ^1.0
I search a solution, put this line in my composer.json using tilde before 1.0
"league/flysystem-aws-s3-v3": "~1.0",
It working!!
The laravel documentation suggests this command for Laravel 8
composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
and it worked for me. Earlier, I was trying to install using the command from an older version of laravel docs.
My PHP version is 7.4
Ref: https://laravel.com/docs/8.x/filesystem#composer-packages
There are 2 ways with php 7.x and laravel 8 :
In mac :
composer require league/flysystem-aws-s3-v3 ~1.0
In windows :
composer require league/flysystem-aws-s3-v3 ~1.0 --ignore-platform-reqs
EDIT: when we use ~1.0, it means that we need this approximate version. And in windows, using the --ignore-platform-reqs skip the problems if you don't have all requirements, plugins etc, it's not the most efficient way but it can help temporary until production deployment. If you don't use --ignore-platform-reqs in windows, maybe it can works, depending your environment.
According to this post:
using ~version: "Approximately equivalent to version", will update you to all future patch versions, without incrementing the minor version. ~1.2.3 will use releases from 1.2.3 to <1.3.0.
using ^version: "Compatible with version", will update you to all future minor/patch versions, without incrementing the major version. ^2.3.4 will use releases from 2.3.4 to <3.0.0.
Follow these steps and you will be able to install both packages
uninstall the current guzzle version
composer remove guzzlehttp/guzzle
install the flysystem ver. - 1.0.0
composer require league/flysystem-aws-s3-v3:^1.0
Good luck :-)
in this order it seems that laravel 8 is able to download and install both s

composer installation fails - jimmyjs/laravel-report-generator

Trying to install jimmyjs/laravel-report-generator
Command:
composer require jimmyjs/laravel-report-generator
Output:
vagrant#homestead:~/code/BEAM$ composer require jimmyjs/laravel-report-generator
Using version ^1.1 for jimmyjs/laravel-report-generator
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
- Can only install one of: maatwebsite/excel[3.1.11, 2.1.x-dev].
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
- jimmyjs/laravel-report-generator 1.1.0 requires maatwebsite/excel ~2.1.0
-> satisfiable by maatwebsite/excel[2.1.x-dev].
- Installation request for jimmyjs/laravel-report-generator ^1.1
-> satisfiable by jimmyjs/laravel-report-generator[1.1.0].
- Installation request for maatwebsite/excel (locked at 3.1.11, required as ^3.1)
-> satisfiable by maatwebsite/excel[3.1.11].
Installation failed, reverting ./composer.json to its original content.
I don't know if I'm misunderstanding the error? Says I can only have one maatwebsite (which is the case)?
composer.json current require which has maatwebsite (only instance) in it:
"require": {
"php": ">=7.1.3",
"barryvdh/laravel-snappy": "^0.4.4",
"fideloper/proxy": "^4.0",
"h4cc/wkhtmltoimage-amd64": "0.12.x",
"h4cc/wkhtmltopdf-amd64": "0.12.x",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.6",
"maatwebsite/excel": "^3.1",
"spatie/laravel-permission": "^2.13"
},
if you need explicitly that version of Maatwebsite ("maatwebsite/excel": "^3.1",), then you cant fix it cause jimmyjs/laravel-report-generator is not up to date with the new version of maatwebsite.
if you dont need the version 3 of Maatwebsite, you can remove the requirement for it and jimmyjs/laravel-report-generator will require the version maatwebsite/excel 2.1.x-dev.
wich might have some issue with your current version of php (7.1).
Better look for another alternative to jimmyjs/laravel-report-generator that uses the V3 of maatwebsite or something else
Or even better, do it yourself instead of using jimmyjs/laravel-report-generator. Maatwebsite v3 is really easy to use
If you have looked it then your version is 3.1 "maatwebsite/excel": "^3.1",
Now check your error
Problem 1
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
it says you need to install in "maatwebsite/excel": "^2.1"
Change and Add in your composer.json file:
"require": {
"jimmyjs/laravel-report-generator": "^1.1",
"maatwebsite/excel": "^2.1"
},
after, run this command in your command prompt composer update

Your requirements could not be resolved: failed to open stream: Permission denied

I Need to install DomPDf in my Project. So, i add "barryvdh/laravel-dompdf": "v0.7.0", to composer require block. when i update composer display following Errors. Whats my Mistakes.... Please Specify to me..
Terminal Errors
Your requirements could not be resolved to an installable set of packages.
Problem 1
- dompdf/dompdf v0.7.0-beta3 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta2 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta requires phenx/php-font-lib 0.3.* -> no matching package found.
- dompdf/dompdf v0.7.0 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf 0.7.x-dev requires phenx/php-font-lib 0.5.* -> no matching package found.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[0.7.x-dev, v0.7.0, v0.7.0-beta, v0.7.0-beta2, v0.7.0-beta3].
- Installation request for barryvdh/laravel-dompdf v0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
My Composer Code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"minimum-stability" : "dev",
"prefer-stable": true,
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-dompdf": "v0.7.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"uxweb/sweet-alert": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
}
I've also tried:
composer require barryvdh/laravel-dompdf
but it display following error:
Error : Using version ^0.8.0 for barryvdh/laravel-dompdf ./composer.json has been updated Loading composer repositories with package information
Updating dependencies (including require-dev)
file_put_contents(/home/w3cert/.composer/cache/repo/https---‌​packagist.org/p-prov‌​ider-2017-01.json): failed to open stream: Permission denied
packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Your requirements could not be resolved to an installable set of packages.
Since you've got the Permission denied error when running composer require barryvdh/laravel-dompdf, this is the command which should fix them:
chown -R $USER ~/.composer
or:
sudo chown -R $USER ~/.composer
Then clear the Composer caches:
composer clear
After than try to avoid running composer command with sudo to not break the file permissions.
If there is still any problem, in order to troubleshoot, run the following shell command:
composer diagnose
Why don't you try to install it from the command line
composer require barryvdh/laravel-dompdf
please delete this line from composer.json before installation.
"barryvdh/laravel-dompdf": "v0.7.0"
Anyway the current version of laravel-dompdf:(v0.8.0)
The installation should work with the current version of dompdf
"barryvdh/laravel-dompdf": "^0.8.0"

Resources