Nick Poulos
Nick Poulos

Reputation: 488

Composer Errors On Vagrant Sync'd Folders

I am having some strange issues during Composer installs/updates that seem to have started appearing after upgrading Laravel Homestead from v6.x to 9.0.2.

It seems Composer is bombing anytime I run it when inside of a sync'd folder with the host, which is obviously all the time. When I vagrant ssh in, do a new composer create-project --prefer-dist laravel/laravel in a sync'd folder, I see the following errors, ALWAYS on the same packages, which is weird:

- Installing symfony/var-dumper (v4.3.2): Loading from cache
        Skipped installation of bin Resources/bin/var-dump-server for package symfony/var-dumper: file not found in package

- Installing nikic/php-parser (v4.2.2): Loading from cache
        Skipped installation of bin bin/php-parse for package nikic/php-parser: file not found in package

- Installing psy/psysh (v0.9.9): Loading from cache
    Skipped installation of bin bin/psysh for package psy/psysh: file not found in package

- Installing phpunit/phpunit (7.5.13): Loading from cache
    Skipped installation of bin phpunit for package phpunit/phpunit: file not found in package

And then eventually I get this at the end:

  [RuntimeException]
  Could not scan for classes inside "/home/vagrant/testapp.com/vendor/sebastian/object-enumerator/src/" which does not appear to be a file nor a folder

When I actually watch the /vendor/ folder in Finder while dependencies are installing, I watch the current dependency folder appear, then disappear...then the next one, appears, then disappear. At the end the only folder & file left in /vendor/ is /vendor/composer/installed.json, which appears to look correct when I open it.

Now, when I do a new composer create-project --prefer-dist laravel/laravel, in a NON-sync'd new folder. Boom everything works fine. This weird series of errors is also happening on all of my older projects as well during composer install, composer update, not just during composer create-projects.

Has anybody every come across this at all? I have tried just about everything, rm -rf /vendor/, delete composer.lock, composer clear-cache, etc. I am out of ideas.

Thanks

Upvotes: 1

Views: 1169

Answers (1)

Nick Poulos
Nick Poulos

Reputation: 488

After reading some more, it seems there are some issues with OSX Mojave and VirtualBox shared folders apparently. By enabling NFS, this issue has been fixed.

https://www.vagrantup.com/docs/synced-folders/nfs.html

https://tech.osteel.me/posts/2016/01/19/how-to-enable-nfs-on-laravel-homestead.html

Upvotes: 4

Related Questions