Error installing package (Installation failed, reverting ./composer.json to its original content.) (Laravel admin package - Voyager) [duplicate] - laravel

This question already has answers here:
Composer error: "PHP extension fileinfo is missing from your system"
(12 answers)
How can I resolve "Your requirements could not be resolved to an installable set of packages" error?
(17 answers)
Closed 3 years ago.
i want to install a laravel admin package -voyager version 1.3 ,so when i run this cmd $ composer require tcg/voyager i got this error always , is about the file composer.json
Using version ^1.3 for tcg/voyager
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
- tcg/voyager v1.3.0 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- tcg/voyager v1.3.1 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- intervention/image 2.4.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.4.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- Installation request for tcg/voyager ^1.3 -> satisfiable by tcg/voyager[v1.3.0, v1.3.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\AppServ\php7\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
and this is the file composer.json :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.2",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}, ..
, Do you know how to solve that? my laravel version : 6.12

Try enabling php_fileinfo.dll in you php.ini file. Just remove ; from the below line and restart your server
;extension=php_fileinfo.dll

Related

Cannot update dependencies with composer

I am trying to install the package tymon/jwt-auth via composer on production server and I am getting errors while resolving dependencies.
I have installed it succesfully on my local vagrant environment but when on production server the following output.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install laravel/socialite 3.0.x-dev
- Conclusion: remove guzzlehttp/guzzle 6.2.x-dev|install laravel/socialite 3.0.x-dev
- laravel/socialite v2.0.0 requires guzzlehttp/guzzle ~4.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev].
- laravel/socialite v2.0.1 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.2 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.3 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.4 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.0, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.1, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.2, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.3, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[4.x-dev, 6.2.x-dev].
- Installation request for guzzlehttp/guzzle (locked at 6.2.x-dev, required as ~5.3|~6.0) -> satisfiable by guzzlehttp/guzzle[6.2.x-dev].
- Conclusion: remove laravel/socialite 3.0.x-dev|install laravel/socialite v2.0.0|install laravel/socialite v2.0.1|install laravel/socialite v2.0.2|install laravel/socialite v2.0.3|install laravel/socialite v2.0.4
- Can only install one of: laravel/socialite[2.0.x-dev, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.10, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.11, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.12, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.13, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.14, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.15, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.16, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.17, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.18, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.19, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.20, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.21, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.22, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.5, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.6, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.7, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.8, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.9, 3.0.x-dev].
- Installation request for laravel/socialite (locked at 3.0.x-dev, required as ^2.0#dev) -> satisfiable by laravel/socialite[3.0.x-dev].
- Installation request for laravel/socialite ^2.0#dev -> satisfiable by laravel/socialite[2.0.x-dev, v2.0.0, v2.0.1, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.2, v2.0.20, v2.0.21, v2.0.22, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
I've tried both on the server by running composer update and by doing composer require tymon/jwt-auth.
How can start resolving this problem?
Thanks in advance.
PS: This is my composer.json file.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
"repositories": [
{
"type": "git",
"url": "https://github.com/cholung/laravel-model-builder.git"
},
{
"type": "git",
"url": "https://github.com/vorodevops/l5scaffold.git"
},
{
"type": "vcs",
"url": "https://github.com/alnutile/l5scaffold.git"
}
],
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"ramsey/uuid": "^3.2",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "~5.3|~6.0",
"laravel/socialite": "^2.0#dev",
"predis/predis": "^1.1#dev",
"pda/pheanstalk": "~3.0",
"xinax/laravel-gettext": "3.x",
"laravelcollective/html": "5.1.*",
"doctrine/dbal": "^2.5",
"moltin/laravel-cart": "^5.0",
"jenssegers/date": "^3.2",
"barryvdh/laravel-dompdf": "0.6.*",
"maatwebsite/excel": "~2.1.0",
"jenssegers/agent": "^2.3",
"yajra/laravel-datatables-oracle": "~6.0",
"wisembly/elephant.io": "^3.1",
"dimsav/laravel-translatable": "^6.0",
"sammyk/laravel-facebook-sdk": "^3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"jimbolino/laravel-model-builder" : "dev-master",
"laralib/l5scaffold": "dev-viewonly",
"barryvdh/laravel-debugbar": "^2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Artvisual\\Tools\\": "packages/artvisual/tools/src",
"Artvisual\\Tools\\Providers\\": "packages/artvisual/tools/src/Providers",
"Artvisual\\Payment\\": "packages/artvisual/payment/src"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
In case anyone still needs a solution to this. In this guide it says that you should
composer require the older version of guzzlehttp/guzzle, like for example composer require guzzlehttp/guzzle:^5.3.0
composer require the package you were looking out to install in the first place, like for example composer require laravel/socialite
composer remove the guzzlehttp/guzzle dependency again with composer remove guzzlehttp/guzzle
I got this error when requiring the jonasva/google-trends dependency and this solved it for me.
I've had same issue and the guzzle version was 7.0.
I have solved it by changing the version to 6.0 in composer.json and updated it.

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

how to remove laravel with composer on linux mint 18.3(ubuntu 16.04)

I install Laravel with the default composer
sudo composer create-project laravel/laravel laravel 5.6
then I found a lot of error cause the compose is version 1.0x so old
then I remove the composer and update the composer to version 1.7.2
the question is how can I remove the bad laravel?
Can I just del the laravel directory?
I try
sudo apt-get purge laravel
sudo apt-get purge laravel/laravle
sudo apt-get purge laravel/laravel laravel 5.6
it shows cannot find the laravel
my var/www/html/laravel composer.json is below
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.3",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"nunomaduro/collision": "~1.1",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~7.0",
"symfony/thanks": "^1.0"
},
$composer remove laravel/laravel
this can solve this question!

Why can't I install oauth2 client?

getting some strange errors with composer, anyone know what I can do next? I am trying to install oauth2 client on Laravel 5.1 so that I can use it to connect to an affiliate network API.
Using version ~2.2 for league/oauth2-client
./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
- Installation request for league/oauth2-client ~2.2 -> satisfiable by league/oauth2-client[2.2.0].
- Conclusion: remove paragonie/random_compat v1.4.2
- league/oauth2-client 2.2.0 requires paragonie/random_compat ^2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- Can only install one of: paragonie/random_compat[v2.0.0, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.1, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.10, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.2, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.3, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.4, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.5, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.6, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.7, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.8, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.9, v1.4.2].
- Installation request for paragonie/random_compat == 1.4.2.0 -> satisfiable by paragonie/random_compat[v1.4.2].
Installation failed, reverting ./composer.json to its original content.
my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"bestmomo/scafold": "dev-master",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.6.*",
"davejamesmiller/laravel-breadcrumbs": "~3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database",
"app/helpers"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
The output of your install attempt has all the information:
Currently there is paragonie/random_compat v1.4.2 installed. Your new package requires paragonie/random_compat ^2.0 - this is an incompatible change (simply by looking at the version number, not at the code), so Composer cannot simply install the newer version.
However, some component already installed requires that older version. You can find out which one it is by running composer why paragonie/random_compat, and you can also find out why it wasn't possible to install the newer version by running composer why-not paragonie/random_compat ^2.0, which will probably output the same information.
All in all I think the suggestion on how to solve this is: Upgrade Laravel. 5.1 is rather old, and it depends on paragonie/random_compat in version ~1.4. Newer versions of Laravel (5.3 and 5.4) allow either ~1.4 or ~2.0, which would fix your issue.
I haven't looked deeper into this issue, though. It might be possible that another component also depends on this library and would also need to be updated. Laravel was my first guess.

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