Franko Hysaj
Franko Hysaj

Reputation: 99

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.

Upvotes: 5

Views: 32823

Answers (4)

Muhammad
Muhammad

Reputation: 387

Run this command composer require barryvdh/laravel-dompdf "^0.8.2" .

Upvotes: 4

xyzale
xyzale

Reputation: 795

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.

Upvotes: 6

Igor Finagin
Igor Finagin

Reputation: 13

Check then dompdf/dompdf may updated e.g. 0.7.* or ~0.7.0

composer update;
composer require barryvdh/laravel-dompdf;

Upvotes: 0

Sapnesh Naik
Sapnesh Naik

Reputation: 11656

Delete your composer.lock file and run:

composer install

Upvotes: 1

Related Questions