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

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

Open
ricpelo opened this issue Jan 13, 2024 · 4 comments

Comments

@ricpelo
Copy link
Contributor

ricpelo commented Jan 13, 2024

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
@mtangoo
Copy link
Contributor

mtangoo commented Jan 29, 2024

Hi @ricpelo
does it work with PHP 8.1?

@neoacevedo
Copy link

According with #297 (comment) this package should support php 8.2 (or later, I think).

@bizley
Copy link
Member

bizley commented Jul 10, 2024

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).

@neoacevedo
Copy link

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.

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

4 participants