Composer always fails to install symfony/var-dumper

Viewed 1915

I'm trying to install the latest version of Laravel 8 on the latest version of Homestead. When I run composer install or composer update, installation of symfony/var-dumper always fails:

Installing symfony/var-dumper (v5.2.6): Extracting archive
Install of symfony/var-dumper failed

[ErrorException]
file_get_contents(/home/vagrant/code/vendor/symfony/var-dumper/Resources/bin/var-dump-server): 
    Failed to open stream: No such file or directory

Despite the error exception, the file /vendor/symfony/var-dumper/Resources/bin/var-dump-server does exist.

Things I've tried:

  • Deleting the lock file and re-running composer update
  • Manually specifying specific versions of var-dumper, e.g. composer require symfony/var-dumper:5.2.0

I always get the same errors.

3 Answers

Remove /vendor folder, then run:

composer update -v

This turned out to be a compatibility issue with Composer 2.x. I downgraded to the 1.x channel using composer self-update --1, then ran composer install again, and the installation succeeded.

Composer version 2.2.4 2022-01-08 12:30:42

and

symfony/var-dumper v5.4.3

is working just fine

Related