How to fix error abandoned fzaninotto/faker packagist in composer 2.0.11 version and i used php 8.0.0? - composer-php

How to fix fzaninotto/faker packagist
"This package is abandoned and no longer maintained. No replacement package was suggested."
in composer 2.0.11 version and i used php 8.0.0?

The quick way is
composer remove fzaninotto/faker
Then install
composer require fakerphp/faker --dev

You can use the new package faker (fork).
Remove the faker abandoned
composer remove vendor/fzaninotto/faker
Install the new package
composer require fakerphp/faker
And replace it in your composer.json
"require-dev": {
"fakerphp/faker": "^1.13.0",
}

Related

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.

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

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

Can I solve "Your requirements could not be resolved to an installable set of packages." in laravel composer

when I want to install laravel/ui the composer show this:
and my composer.json :
my laravel version is 6.13 and I went to laravel.com and I click the Authentication for laravel 6X and says for laravel 6 you have to install this package and the package is composer require laravel/ui "^1.0" --dev and composer show me that problem again what can I do?
Add this in composer.json and then use command composer update
"laravel/ui": "^1.2",
Sometimes the library which you're installing is not satisfied PHP version not only laravel version.

How do I upgrade a composer package after having constrained the version?

Suppose that for stability reasons, I've constrained the version of a particular package in composer.json:
"require": {
"foo/bar": "~3.2.6",
}
I am now ready to upgrade foo/bar to version 4.
What is the correct workflow to do this?
Should I edit the composer.json file by hand and run one of composer install or update? Or should I do composer require foo/bar 4?
composer require vendor/package:version
like :
composer require foo/bar:^4.0.0

Resources