Laravel new command fails with The command "'herd' 'tld' '-v'" failed.
Hey,
I am just getting started with laravel.I've installed php with homebrew, valet, composer and xdebug and they all work. I can even debug Laravel applications. However I cannot generate new projects
laravel new test fails with
In Process.php line 371:
The command "'herd' 'tld' '-v'" failed.
Working directory: /Users/cengiz
Error: proc_open(): posix_spawn() failed: No such file or directory
What could be the reason for that? I am not using herd anymore I tried using herd first but it didnt really worj
It looks like the issue is related to the herd command, which is no longer available or properly configured on your system. Laravel Valet might still be trying to use herd for some of its operations. Here are the steps you can take to resolve this issue:
Uninstall Herd: If you have previously installed herd, make sure it is completely uninstalled from your system.
Reinstall Laravel Valet: Sometimes, reinstalling Valet can help reset its configuration and dependencies.
Check Valet Configuration: Ensure that Valet is not configured to use herd. You can do this by running the following commands:
valet uninstall
valet install
Clear Valet Configuration: If the above steps do not work, you might need to clear Valet's configuration files manually. You can do this by removing the .valet directory in your home directory:
rm -rf ~/.valet
valet install
Check PATH Environment Variable: Ensure that your PATH environment variable is correctly set up to include the paths to PHP, Composer, and other necessary binaries. You can check this by running:
echo $PATH
Make sure it includes paths like /usr/local/bin and the directory where Composer's global binaries are installed (usually ~/.composer/vendor/bin or ~/.config/composer/vendor/bin).
Create a New Laravel Project Using Composer: As an alternative, you can create a new Laravel project using Composer directly:
composer create-project --prefer-dist laravel/laravel test
By following these steps, you should be able to resolve the issue and create new Laravel projects without encountering the herd command error. If the problem persists, please provide more details about your environment and any additional error messages you encounter.
I have the same problem, I'm running Arch Linux and I've installed Laravel globally through composer. I'm not using Herd, and I've never installed it on my machine
I'm getting the same error with another laravel command: php artisan about
Symfony\Component\Process\Exception\ProcessStartFailedException
The command "''\''/opt/homebrew/Cellar/php/8.3.7/bin/php'\''' 'composer.phar' '-V' '--no-ansi'" failed.
Working directory: /Users/nils/Sites/XXXXX
Error: proc_open(): posix_spawn() failed: No such file or directory
at vendor/symfony/process/Process.php:371
367▕ restore_error_handler();
368▕ }
369▕
370▕ if (!\is_resource($process)) {
➜ 371▕ throw new ProcessStartFailedException($this, $lastError);
372▕ }
373▕ $this->process = $process;
374▕ $this->status = self::STATUS_STARTED;
375▕
I've upgraded symfony/process from v7.0.7 to v7.1.0. With this version (v7.1.0) I'm getting the error. After downgrading symfony/process to v7.0.7 the error disappears.