Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install stolt/lean-package-validator #1

Open
raphaelstolt opened this issue Oct 1, 2024 · 1 comment
Open

Unable to install stolt/lean-package-validator #1

raphaelstolt opened this issue Oct 1, 2024 · 1 comment

Comments

@raphaelstolt
Copy link

raphaelstolt commented Oct 1, 2024

When calling cpx stolt/lean-package-validator validate I get the following error message:

Installing stolt/lean-package-validator...
PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony/Component/Console/Helper/HelperSet.php on line 104
PHP Fatal error:  Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge()
#1 /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 /usr/share/php/Composer/DependencyResolver/Solver.php(387): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 /usr/share/php/Composer/DependencyResolver/Solver.php(740): Composer\DependencyResolver\Solver->selectAndInstall()
#4 /usr/share/php/Composer/DependencyResolver/Solver.php(231): Composer\DependencyResolver\Solver->runSat()
#5 /usr/share/php/Composer/Installer.php(489): Composer\DependencyResolver\Solver->solve()
#6 /usr/share/php/Composer/Installer.php(232): Composer\Installer->doInstall()
#7 /usr/share/php/Composer/Command/RequireCommand.php(248): Composer\Installer->run()
#8 /usr/share/php/Composer/Command/RequireCommand.php(205): Composer\Command\RequireCommand->doUpdate()
#9 /usr/share/php/Symfony/Component/Console/Command/Command.php(255): Composer\Command\RequireCommand->execute()
#10 /usr/share/php/Symfony/Component/Console/Application.php(934): Symfony\Component\Console\Command\Command->run()
#11 /usr/share/php/Symfony/Component/Console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 /usr/share/php/Composer/Console/Application.php(281): Symfony\Component\Console\Application->doRun()
#13 /usr/share/php/Symfony/Component/Console/Application.php(149): Composer\Console\Application->doRun()
#14 /usr/share/php/Composer/Console/Application.php(113): Symfony\Component\Console\Application->run()
#15 /usr/bin/composer(62): Composer\Console\Application->run()
#16 {main}
  thrown in /usr/share/php/Composer/DependencyResolver/DefaultPolicy.php on line 84
PHP Fatal error:  Uncaught Exception: Composer command failed: require stolt/lean-package-validator --no-interaction --no-progress in /home/vagrant/.config/composer/vendor/cpx/cpx/src/Composer.php:17
Stack trace:
#0 /home/vagrant/.config/composer/vendor/cpx/cpx/src/Package.php(153): Cpx\Composer::runCommand()
#1 /home/vagrant/.config/composer/vendor/cpx/cpx/src/Package.php(62): Cpx\Package->installOrUpdatePackage()
#2 /home/vagrant/.config/composer/vendor/cpx/cpx/cpx(60): Cpx\Package->runCommand()
#3 /home/vagrant/.config/composer/vendor/bin/cpx(119): include('...')
#4 {main}
  thrown in /home/vagrant/.config/composer/vendor/cpx/cpx/src/Composer.php on line 17

Runtime environment

$ cpx --version
cpx version: 1.0.1
php version: 8.2.21
$ composer2 --version
Composer version 2.7.9 2024-09-04 14:43:28
PHP version 8.2.21 (/usr/bin/php8.2)
@imliam
Copy link
Owner

imliam commented Oct 1, 2024

Currently cpx is using the global composer command loaded in your shell. Since I see you're running composer2 here, is composer --version running the (now deprecated) v1?

I can aim to make cpx smarter about finding the correct Composer install (or give a better error message in this scenario if it only finds v1).

For what it's worth, this command seems to run perfectly fine for me:

cpx stolt/lean-package-validator validate

stolt/lean-package-validator is already installed and doesn't need updating.
Running bin/lean-package-validator from stolt/lean-package-validator

The present .gitattributes file is considered invalid.

Would expect the following .gitattributes file content:
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

.editorconfig export-ignore
.env.example export-ignore
.gitattributes export-ignore
.gitignore export-ignore
composer.lock export-ignore
package-lock.json export-ignore
package.json export-ignore
packages/ export-ignore
phpunit.xml export-ignore
README.md export-ignore
tests/ export-ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants