laravel / homestead

MIT License
3.85k stars 1.45k forks source link

Problem installing using composer due to symfony/yaml dependency #1943

Closed josueprocomp closed 5 months ago

josueprocomp commented 5 months ago

When installing Laravel 10 locally it installs symfony/yaml 7, because laravel/sail has a symfony/yaml dependency: "^6.0|^7.0".

But when installing after Homestead using composer as vendor (per project installation), and having Homestead a symfony/yaml dependency: "^5.0 || ^6.0" a conflict occurs, since the local Laravel project already has symfony/yaml locked to version 7 in composer.lock.

Expected behavior

Homestead should install without problems (conflicts) on a fresh Laravel installation, when running:

composer require laravel/homestead --dev

Actual behavior

$ composer require laravel/homestead --dev

./composer.json has been updated Running composer update laravel/homestead Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/homestead:*" to figure out if any version is installable, or "composer require laravel/homestead:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Steps to reproduce

$ composer create-project laravel/laravel example-app $ cd example-app $ composer require laravel/homestead --dev

Solution

If Homestead supports symfony/yaml 7, update the dependency in composer.json to:

"symfony/yaml": "^5.0 || ^6.0 || ^7.0"

Workaround

$ composer require laravel/homestead --dev --with-all-dependencies ./composer.json has been updated Running composer update laravel/homestead --with-all-dependencies Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 1 update, 0 removals

83 packages you are using are looking for funding. Use the composer fund command to find out more!

@php artisan vendor:publish --tag=laravel-assets --ansi --force

INFO No publishable resources for tag [laravel-assets].

No security vulnerability advisories found. Using version ^15.0 for laravel/homestead

ALameLlama commented 5 months ago

https://github.com/laravel/homestead/pull/1944

svpernova09 commented 5 months ago

adding https://github.com/laravel/homestead/pull/1946.

svpernova09 commented 5 months ago

Released https://github.com/laravel/homestead/releases/tag/v15.0.2 which should resolve this.