0
votes

Windows 10 / VirtualBox / Vagrant / Homestead

I've begun experiencing random errors like the following every time I run "laravel new PROJECT":

  • Installing phpunit/phpunit (9.5.0): Extracting archive 85/95 [=========================>--] 89% Failed to extract laravel/framework: (2) unzip -qq '/home/vagrant/code/PROJECT/vendor/composer/tmp-f4716ecd4eeb00c7e1d90a043cc4a5b5' -d '/home/vagrant/code/PROJECT/vendor/composer/123a874a' /home/vagrant/code/PROJECT/vendor/composer/123a874a/laravel-framework-6350d19/src/Illuminate/Database/Eloquent/Collection.php bad CRC 5a1bfd51 (should be 58446226) The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems) Unzip with unzip command failed, falling back to ZipArchive class

The errors occur on different packages each time. Sometimes the process completes and displays "Application ready!", many times it fails.

So far I've tried:

  • composer clearcache
  • reinstalling vagrant
  • reinstalling vagrant laravel/homestead box
  • reinstalling homestead
  • deactivating the Windows Linux subsystem. I had enabled it for another purpose around the time the errors began, and wondered if it did something with case sensitivity.

All with no effect. Any ideas?

1
Have you tried increasing the memory_limit in your php.ini?Alex Mac
@AlexMac Yes, I went all the way to 8GB by modifying my phpini and VagrantFile. It runs faster, but identical issues. (Interestingly, the "laravel new" process seems to consume up to around 650MB, but Windows task manager reports VirtualBox only using around 50MB) When the process does complete to "Application Ready!", any process like "npm run dev" fails with syntax errors regarding unknown characters in files. So there is certainly file corruption happening. Any other ideas?Ben CLS
you could try composer install --prefer-source which will pull a non archived version of the source, I think.Alex Mac
@AlexMac Thanks for your help. That didn't work in itself but led me to discover VirtualBox was the culprit. See answer.Ben CLS

1 Answers

0
votes

Solved

Finally made it work only by reinstalling VirtualBox, Vagrant, the Vagrant homestead box, and Homestead. Before reinstalling VirtualBox and Vagrant, I removed my homestead directory and all related application data files (in my case located in C:\Users\USERNAME).

It appears networking issues within VirtualBox were corrupting files pulled by "git clone" commands in the "laravel new" process.