Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[Dúvida] Erro ao instalar pacotes com composer

Olá,

Ao tentar instalar o PHPUnit com o comando composer install ou composer update ocorre falha nos pacotes phpunit/phpunit e phpunit/php-code-coverage e é retornado os seguintes erros:

Install of phpunit/php-code-coverage failed Install of phpunit/phpunit failed

Failed to execute git checkout be1fe461fdc917de2a29a452ccf2657d325b443d -- && git reset --hard be1fe461fdc917de2a29a452ccf2657d325b443d --

HEAD is now at be1fe461 Prepare release error: unable to create file tests/_files/Report/HTML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.html: Filename too long error: unable to create file tests/_files/Report/XML/CoverageForClassWithAnonymousFunction/source_with_class_and_anonymous_function.php.xml: Filename too long fatal: Could not reset index file to revision 'be1fe461fdc917de2a29a452ccf2657d325b443d'.

It looks like the commit hash is not available in the repository, maybe the tag was recreated? Run "composer update phpunit/php-code-coverage" to resolve this.

Já tentei rodar o comando que é sugerido na mensagem e mesmo assim não funcionou. Estou utilizando o php na versão 8.2.8 e o arquivo composer.json esta com o require do php >=7.3 e o phpunit ^10.0.

1 resposta
solução!

Olá,

Consegui resolver o problema habilitando o parâmetro extension=zip no arquivo php.ini.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software