Symfony 4.2 composer install error in Laravel Homestead

  composer-php, homestead, symfony

I need to modify a Symfony 4.2.8 application. To achieve this, I downloaded the project folder, without the vendor/, var/log/ and var/cache/ directories.

But when I first run the command

$ composer install

I get the following error:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on the current platform.
Package operations: 87 installs, 0 updates, 0 removals

  • Installing composer/package-versions-deprecated ( Extracting archive Plugin initialization failed
    failed to open stream: No such file or directory), uninstalling plugin
  • Removing composer/package-versions-deprecated (
    Install of composer/package-versions-deprecated failed

[RuntimeException] Could not delete

install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-suggest] [–no-dev] [–no-autoloader] [–no-scripts] [–no-progress] [–no-install] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [–ignore-platform-req IGNORE-PLATFORM-REQ] [–ignore-platform-reqs] [–] []…

  • Composer version: 2.0.6
  • Laravel Homestead version: 9.6.0

My Homestead.yml is:

- map: symfony4app.local
  to: /home/vagrant/TheSymfonyApp4.2/public
  type: symfony4

When I browse the application locally I get the following error:

Warning: require(/home/vagrant/TheSymfonyApp4.2/vendor/autoload.php):
failed to open stream: No such file or directory in
/home/vagrant/TheSymfonyApp4.2/config/bootstrap.php on line 5

What am I missing?
Any other ideas to make this app run locally on MacOS?

Source: Symfony Questions