5
respostas

laravel: command not found

Apesar de ter feito a instalalação do laravel corretamente, não consigo chamar o comando laravel.

A unica parte da instalação que tive problema foi quando dei os comandos

brew tap homebrew/dupes
brew tap homebrew/versions

e obtive esses resutados

Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Error: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
5 respostas
MacBook-Air-de-Renan:~ renanneri$ composer global require "laravel/installer=~1.1"
Changed current directory to /Users/renanneri/.composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 9 installs, 0 updates, 0 removals
  - Installing symfony/process (v4.0.6): Downloading (100%)         
  - Installing symfony/filesystem (v4.0.6): Downloading (100%)         
  - Installing symfony/polyfill-mbstring (v1.7.0): Downloading (100%)         
  - Installing symfony/console (v4.0.6): Downloading (100%)         
  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%)         
  - Installing psr/http-message (1.0.1): Downloading (100%)         
  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)         
  - Installing guzzlehttp/guzzle (6.3.0): Downloading (100%)         
  - Installing laravel/installer (v1.5.0): Downloading (100%)         
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/lock ()
symfony/console suggests installing psr/log (For using the console logger)
guzzlehttp/guzzle suggests installing psr/log (Required for using the Log middleware)
Writing lock file
Generating autoload files

Atualização, agora o erro que aprece é esse aqui:

laravel -v
PHP Fatal error:  Default value for parameters with a class type hint can only be NULL in /Users/renanneri/.composer/vendor/symfony/console/Application.php on line 83

Fatal error: Default value for parameters with a class type hint can only be NULL in /Users/renanneri/.composer/vendor/symfony/console/Application.php on line 83

Oi Renan, tudo bom?

Esse erro:

PHP Fatal error:  Default value for parameters with a class type hint can only be NULL in /Users/renanneri/.composer/vendor/symfony/console/Application.php on line 83

Diz que o type hint da classe "dentro do laravel" é restrito apenas à null. O que indica fortemente que a versão do seu PHP não é compativel com a versão do laravel que você está usando. Qual versão do laravel e do php você tem ai na sua maquina?

Estava usando a versão 5.6, mudei para a 7.2 e funcionou. Iniciei um projeto novo e deu um errinho que queria saber se atrapalha muito

 ErrorException  : Declaration of Illuminate\Support\Carbon::__set_state(array $array) should be compatible with Carbon\Carbon::__set_state($state)

  at /Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php: 9
     5| use JsonSerializable;
     6| use Carbon\Carbon as BaseCarbon;
     7| use Illuminate\Support\Traits\Macroable;
     8| 
  >  9| class Carbon extends BaseCarbon implements JsonSerializable
    10| {
    11|     use Macroable;
    12| 
    13|     /**

  Exception trace:

  1   Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Declaration of Illuminate\Support\Carbon::__set_state(array $array) should be compatible with Carbon\Carbon::__set_state($state)", "/Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php", ["/Users/renanneri/projeto/vendor/composer/../laravel/framework/src/Illuminate/Support/Carbon.php"])
      /Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php : 9

  2   include("/Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php")
      /Users/renanneri/projeto/vendor/composer/ClassLoader.php : 444

  Please use the argument -v to see more details.
Script @php artisan key:generate handling the post-create-project-cmd event returned with error code 1
Application ready! Build something amazing.

Nao consegui upar o server

MacBook-Air-de-Renan:projeto renanneri$ php artisan serve -v

   ErrorException  : Declaration of Illuminate\Support\Carbon::__set_state(array $array) should be compatible with Carbon\Carbon::__set_state($state)

  at /Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php: 9
     5| use JsonSerializable;
     6| use Carbon\Carbon as BaseCarbon;
     7| use Illuminate\Support\Traits\Macroable;
     8| 
  >  9| class Carbon extends BaseCarbon implements JsonSerializable
    10| {
    11|     use Macroable;
    12| 
    13|     /**

  Exception trace:

  1   Illuminate\Foundation\Bootstrap\HandleExceptions::handleError("Declaration of Illuminate\Support\Carbon::__set_state(array $array) should be compatible with Carbon\Carbon::__set_state($state)", "/Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php", ["/Users/renanneri/projeto/vendor/composer/../laravel/framework/src/Illuminate/Support/Carbon.php"])
      /Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php : 9

  2   include("/Users/renanneri/projeto/vendor/laravel/framework/src/Illuminate/Support/Carbon.php")
      /Users/renanneri/projeto/vendor/composer/ClassLoader.php : 444

  Please use the argument -v to see more details.