2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel new コマンド PHP Fatal error: Uncaught Error: Call to undefined method

Posted at

Laravelインストーラを使ってインストールした時にエラーが起きた場合の対処法です。

問題

$ laravel new project-name
Crafting application...
PHP Fatal error:  Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/ucan/.composer/vendor/laravel/installer/src/NewCommand.php:84
Stack trace:
#0 /Users/ucan/.composer/vendor/symfony/console/Command/Command.php(251): Laravel\Installer\Console\NewCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /Users/ucan/.composer/vendor/symfony/console/Application.php(886): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/ucan/.composer/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Installer\Console\NewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Users/ucan/.composer/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun in /Users/ucan/.composer/vendor/laravel/installer/src/NewCommand.php on line 84

Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/ucan/.composer/vendor/laravel/installer/src/NewCommand.php:84
Stack trace:
#0 /Users/ucan/.composer/vendor/symfony/console/Command/Command.php(251): Laravel\Installer\Console\NewCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /Users/ucan/.composer/vendor/symfony/console/Application.php(886): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/ucan/.composer/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Installer\Console\NewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Users/ucan/.composer/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun in /Users/ucan/.composer/vendor/laravel/installer/src/NewCommand.php on line 84

Laravelインストーラが古いので更新しましょう...😅

対策

$ composer global update

ディレクトリは作成されてるので削除してやり直しましょう。

$ rm -rf project-name
$ laravel new project-name
$ php artisan -V
Laravel Framework 7.10.3

バージョン表示できたらokです。

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?