yii2-apidoc icon indicating copy to clipboard operation
yii2-apidoc copied to clipboard

Uninstallable with yii2-app-basic due to unsatisfiable nikic/php-parser dependency

Open ricpelo opened this issue 1 year ago • 5 comments
trafficstars

What steps will reproduce the problem?

$ composer require --prefer-dist yiisoft/yii2-apidoc

What's expected?

The package is installed.

What do you get instead?

$ composer require --prefer-dist yiisoft/yii2-apidoc
./composer.json has been updated
Running composer update yiisoft/yii2-apidoc
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - yiisoft/yii2-apidoc[2.0.0, ..., 2.0.6] require nikic/php-parser 0.9.* -> found nikic/php-parser[v0.9.0, ..., v0.9.5] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6] require nikic/php-parser ^1.0 -> found nikic/php-parser[v1.0.0, ..., v1.4.1] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - yiisoft/yii2-apidoc[3.0.0, ..., 3.0.6] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.18.0] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires yiisoft/yii2-apidoc * -> satisfiable by yiisoft/yii2-apidoc[2.0.0, ..., 2.1.6, 3.0.0, ..., 3.0.6].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require yiisoft/yii2-apidoc:*" to figure out if any version is installable, or "composer require yiisoft/yii2-apidoc:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Additional info

Q A
Yii version 2.0.49.3
Yii APIDoc version 3.0.6
PHP version 8.2.12
Operating system Debian GNU/Linux 12

ricpelo avatar Jan 13 '24 15:01 ricpelo

Hi @ricpelo does it work with PHP 8.1?

mtangoo avatar Jan 29 '24 15:01 mtangoo

According with https://github.com/yiisoft/yii2-apidoc/issues/297#issuecomment-1664037132 this package should support php 8.2 (or later, I think).

neoacevedo avatar Jul 09 '24 21:07 neoacevedo

You have nikic/php-parser in v5 but api-doc currently supports ^4.0. Your current options:

  • downgrade nikic/php-parser to v4
  • prepare PR to this package to support nikic/php-parser v5 (should be straight forward I think).

bizley avatar Jul 10 '24 06:07 bizley

I think nikic/php-parser comes from the dev requirement phpunit/phpunit included in the advanced template, while the basic template doesn't have such requirement. Anyway, if the project requires BS5, this package won't be installed neither because of apidoc requires bs2-3.

neoacevedo avatar Aug 08 '24 16:08 neoacevedo