1
resposta

Erro ao executar Composer Install

Olá!

Utilizando o Windows 10, quando tento executar o comando: composer install, é retornado:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - Root composer.json requires php ^7.1.3 but your php version (8.1.0) does not satisfy that requirement.
  Problem 2
    - doctrine/inflector is locked to version v1.3.0 and an update of this package was not requested.
    - doctrine/inflector v1.3.0 requires php ^7.1 -> your php version (8.1.0) does not satisfy that requirement.
  Problem 3
    - laravel/framework is locked to version v5.8.7 and an update of this package was not requested.
    - laravel/framework v5.8.7 requires php ^7.1.3 -> your php version (8.1.0) does not satisfy that requirement.

  .
  .
  .


  Problem 50
    - laravel/framework v5.8.7 requires php ^7.1.3 -> your php version (8.1.0) does not satisfy that requirement.
    - laravel/tinker v1.0.8 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.8.7].
    - laravel/tinker is locked to version v1.0.8 and an update of this package was not requested.

Então executei o comando: composer install --ignore-platform-reqs E então retornou:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 76 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-php72 (v1.11.0): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.11.0): Extracting archive
  - Installing symfony/var-dumper (v4.2.4): Extracting archive
  - Installing symfony/polyfill-ctype (v1.11.0): Extracting archive

  .
  .
  .
  .

  > @php artisan package:discover --ansi

Deprecated: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\wesley.godoy\Documents\Codigos\1540-laravel-parte3-e16cba70325225643fffbc7df6076ea6d2013fec\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1220

Deprecated: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\wesley.godoy\Documents\Codigos\1540-laravel-parte3-e16cba70325225643fffbc7df6076ea6d2013fec\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 1231
.
.
.
#10 C:\Users\wesley.godoy\Documents\Codigos\1540-laravel-parte3-e16cba70325225643fffbc7df6076ea6d2013fec\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(87): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole(Object(ErrorException))
#11 C:\Users\wesley.godoy\Documents\Codigos\1540-laravel-parte3-e16cba70325225643fffbc7df6076ea6d2013fec\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(123): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(ErrorException))
#12 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#13 {main}
  thrown in C:\Users\wesley.godoy\Documents\Codigos\1540-laravel-parte3-e16cba70325225643fffbc7df6076ea6d2013fec\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 855
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
1 resposta

Fala man, tudo bem? Tive alguns problemas parecidos com o seu, para resolver fiz o seguinte: -> Na pasta do projeto, antes de executar o comando composer install, rodei o comando composer update e em seguida rodei o composer install. isso resolveu todos os problemas, espero que ajude.