Error installing extention

Im getting this error when trying to install this extension thru composer.


  Problem 1
    - 2amigos/yii2-usuario[1.1.0, ..., 1.5.1] require yiisoft/yii2-bootstrap ^2.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0, ..., 2.0.11].
    - 2amigos/yii2-usuario[1.0.0, ..., 1.0.13] require yiisoft/yii2-bootstrap ^2.0.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0, ..., 2.0.11].
    - yiisoft/yii2-bootstrap 2.0.0 requires bower-asset/bootstrap 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, v3.1.1, v3.2.0] but the package is fixed to v5.2.3 (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-bootstrap[2.0.1, ..., 2.0.8] require bower-asset/bootstrap 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.3.7] but the package is fixed to v5.2.3 (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-bootstrap[2.0.9, ..., 2.0.11] require bower-asset/bootstrap 3.4.* | 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.4.1] but the package is fixed to v5.2.3 (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 2amigos/yii2-usuario ~1.0 -> satisfiable by 2amigos/yii2-usuario[1.0.0, ..., 1.5.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

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

yall know how to fix it?

2 Likes

The package you’re attempting to install has dependencies you’re not fulfilling - just run the same composer install command with the following option: “-W”.

1 Like

After doing this im facing the same issue.

PS C:\xampp\htdocs\Schoolproject> composer -W require 2amigos/yii2-usuario:~1.0
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been updated
Running composer update 2amigos/yii2-usuario --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - 2amigos/yii2-usuario[1.1.0, ..., 1.5.1] require yiisoft/yii2-bootstrap ^2.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0, ..., 2.0.11].
    - 2amigos/yii2-usuario[1.0.0, ..., 1.0.13] require yiisoft/yii2-bootstrap ^2.0.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0, ..., 2.0.11].
    - yiisoft/yii2-bootstrap 2.0.0 requires bower-asset/bootstrap 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, v3.1.1, v3.2.0] but these were not loaded, likely because it conflicts with another require.
    - yiisoft/yii2-bootstrap[2.0.1, ..., 2.0.8] require bower-asset/bootstrap 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.3.7] but these were not loaded, likely because it conflicts with another require.
    - yiisoft/yii2-bootstrap[2.0.9, ..., 2.0.11] require bower-asset/bootstrap 3.4.* | 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.4.1] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires 2amigos/yii2-usuario ~1.0 -> satisfiable by 2amigos/yii2-usuario[1.0.0, ..., 1.5.1].


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

Do you have "bower-asset/bootstrap": "^3.3", listed in your composer.json?

added that and gave me the same errors

Hm, you should be getting your dependencies installed.

If you add the following:

"bower-asset/bootstrap": "^3.3"
"yiisoft/yii2-bootstrap": "^2.0

The crux is your 2amigos/yii2-usuario package requires both yii2-boostrap and bower-asset/bootstrap so you just need to have both those accounted for in your composer.json with the correct versions. After you’ve added those, run composer update and then install your desired package. If it’s still not working then, just post your composer.json so I can take a look :slight_smile:

I get this error when doing composer update.

PS C:\xampp\htdocs\Schoolproject> composer update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension.
  Problem 2
    - Root composer.json requires yiisoft/yii2-bootstrap5 ~2.0.2 -> satisfiable by yiisoft/yii2-bootstrap5[2.0.2, 2.0.3, 2.0.4].
    - yiisoft/yii2-bootstrap5[2.0.2, ..., 2.0.4] require bower-asset/bootstrap ^5.1.0 -> found bower-asset/bootstrap[v5.1.0, ..., v5.2.3] but it conflicts with your root composer.json require (^3.3).
  Problem 3
    - phpoffice/phpspreadsheet[1.0.0, ..., 1.8.2] require php ^5.6|^7.0 -> your php version (8.1.10) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.9.0, ..., 1.12.0] require php ^7.1 -> your php version (8.1.10) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.13.0, ..., 1.14.1] require php ^7.2 -> your php version (8.1.10) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.15.0, ..., 1.26.0] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - kartik-v/yii2-export dev-master requires phpoffice/phpspreadsheet >=1.0 -> satisfiable by phpoffice/phpspreadsheet[1.0.0, ..., 1.26.0].
    - Root composer.json requires kartik-v/yii2-export dev-master -> satisfiable by kartik-v/yii2-export[dev-master].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Anyone that knows?

Regarding ext-gd:

I don’t know, but I would try and see what happens if bower-asset/bootstrap >= 2.x is allowed.

https://getcomposer.org/doc/articles/versions.md

On second thought I guess that perhaps bootstrap and bootstrap5 can be installed side by side.
Thus just try adding “bower-asset/bootstrap5”: “^5.1.0” to the require section of composer.json.

(to reinstall everything, assuming a good composer.json, composer.lock and the vendor directory can be removed).

Wait what do u mean?
I have to add “bower-asset/bootstrap5” to composer.json.

And what do i need to do with “composer.lock and the vendor directory”??

I need to delete this??

You don’t need to remove composer.lock and vendor. But it can be done.

after putting “^5.1.0”

Problem 1
    - yiisoft/yii2-bootstrap 2.0.0 requires bower-asset/bootstrap 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, v3.1.1, v3.2.0] but it conflicts with your root composer.json require (^5.1.0).
    - yiisoft/yii2-bootstrap[2.0.1, ..., 2.0.8] require bower-asset/bootstrap 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.3.7] but it conflicts with your root composer.json require (^5.1.0).
    - yiisoft/yii2-bootstrap[2.0.9, ..., 2.0.11] require bower-asset/bootstrap 3.4.* | 3.3.* | 3.2.* | 3.1.* -> found bower-asset/bootstrap[v3.1.0, ..., v3.4.1] but it conflicts with your root composer.json require (^5.1.0).
    - Root composer.json requires yiisoft/yii2-bootstrap ^2.0 -> satisfiable by yiisoft/yii2-bootstrap[2.0.0, ..., 2.0.11].

Did you try this? I don’t know if it’s possible. You’ll have to try it.

Gave me this error

Problem 1
    - Root composer.json requires bower-asset/bootstrap5, it could not be found in any version, there may be a typo in the package name.
  Problem 2
    - Root composer.json requires yiisoft/yii2-bootstrap5 ~2.0.2 -> satisfiable by yiisoft/yii2-bootstrap5[2.0.2, 2.0.3, 2.0.4].
    - yiisoft/yii2-bootstrap5[2.0.2, ..., 2.0.4] require bower-asset/bootstrap ^5.1.0 -> found bower-asset/bootstrap[v5.1.0, ..., v5.2.3] but it conflicts with your root composer.json require (^3.3).

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Have you got a repository for this project? I should be able to see what’s going on with your project that way :slight_smile:

yes! GitHub - DikkiX/Schoolproject

Howdy,

So the issue you were running into is the package you were trying to install: 2amigos/yii2-usario requires yiisoft/yii2-bootstrap: ^2.0 and this package requires bower-asset/bootstrap: 3.4.* | 3.3.* | 3.2.* | 3.1.*.

You were using yiisoft/yii2-boostrap5 and this requires bower-asset/bootstrap: ^5.1.0. The issue here is simply the package you were installing doesn’t have a version compatible with the version of Bootstrap you wanted to use; no worries, that’s generally what you’ll experience when using code in the open-source community. At this point your options are the following:

  1. Find a package with similar / the same functionality that is compatible with the Bootstrap 5 package.
  2. Compromise and revert your codebase to use the Bootstrap 2 package.
  3. Write your own package for the functionality you need that is compatible with the Bootstrap 5 package. In which case, welcome to the open-source community!

I’ve forked your repository and made a PR that fixes your changes here by removing Bootstrap 5, but again you may try any of the previous options if you really need that package: Remove Bootstrap 5, remove PHP ext. by Cuji12 · Pull Request #1 · DikkiX/Schoolproject · GitHub

A note on that, I noticed you had “ext-gd” in your composer dependencies. “ext-gd” literally just means extension GD (Graphics Draw) which is a PHP extension which is used to create and manipulate image files and a whole host of other things related to graphics. These are enabled in your php.ini file. You can read more about the available PHP extensions here: PHP: Alphabetical - Manual and also through the PHP Extension Community Library here if you’re interested: https://pecl.php.net/

2 Likes

Unsure if I’m being dense but this would never work in Composer right? Because you’re attempting to install multiple versions of the same package so their namespace would conflict, no? Referring to the underlying bower-asset dependency rather than the differing yiisoft/bootstrap packages.

As stated I didn’t/don’t now but i found signs of a differently named bower-asset package when googling.

You did a good job taking care of this thread.

2 Likes