Search code examples
laravelhomestead

Homestead 9 fresh box creating a new Laravel project composer Could not scan for classes inside /vendor/phpunit/php-code-coverage/src/


I am trying to set up Homestead as a development environment and am not having much luck. I follow the instructions to get Homestead up and running on https://laravel.com/docs/5.8/homestead#installation-and-setup. The box comes up fine and I can shell in with vagrant ssh. In the code directory which is mapped correctly to a directory on my Windows machine I create a new laravel project with laravel new example and I get the following error

[RuntimeException]
  Could not scan for classes inside "/home/vagrant/code/example/vendor/phpunit/php-code-coverage/src/" which does not appear to be a file nor a folder

I have tried composer update rm -rf vendor && composer install and get the same error. When I use composer install --prefer-source I don't have the install error, but get

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

and
In LoadConfiguration.php line 68: Unable to load the "app" configuration file.

I have checked that I have a .env file and I have checked that the app file name and path is in lowercase.

Any suggestions would be welcome.


Solution

  • Update VirtualBox to v6.

    See this issue on GitHub: https://github.com/laravel/homestead/issues/1219