yiisoft / yii2-app-advanced

Yii 2.0 Advanced Application Template
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
1.66k stars 1.28k forks source link

Remove "yiisoft/yii2-bootstrap4": "~2.0.0", #503

Closed sandor-molnar closed 3 years ago

sandor-molnar commented 3 years ago

What steps will reproduce the problem?

Additional info

I was able to install composer when removed that dependency. I want to use bootstrap 5 anyway.

Q A
Yii version 2.0.43-dev
PHP version 8.0.9
Operating system Windows 10
bizley commented 3 years ago

What are the exact steps of your installation? What is in your composer.json? I just installed dev version without problems. We will definitely not remove Bootstrap dependency just because you don't need it, and there are ways to prevent installing it if you want to omit that package. I'm happy to share it but first I would like to know what happened that ended with the error message.

sandor-molnar commented 3 years ago

@bizley sorry for this bad description, i was really mad at that time, spent like 2 hours to make bootstrap work :D So i downloaded the project with php 7.2. After that wanted to require the bootstrap 5 package ( https://github.com/yiisoft/yii-bootstrap5 ), but i got an error it needs 7.4 grather ("php": "^7.4|^8.0",), so i decided to add php 8, and switch the project on that php. ("php": ">=8.0.0",) After this, i was unable to require the bootstrap 5 package, because of bootstrap 4 has error. For now, i want to install back bootstrap 4 package, because it's needed for admin, but i got the following error for this command:

composer require yiisoft/yii2-bootstrap4
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/browser-kit is locked to version v4.2.4 and an update of this package was not requested.
    - symfony/browser-kit v4.2.4 requires php ^7.1.3 -> your php version (8.0.9) does not satisfy that requirement.
  Problem 2
    - yiisoft/yii2-bootstrap4 2.0.0 requires npm-asset/bootstrap ~4.2 -> found npm-asset/bootstrap[v4.2.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4[2.0.1, ..., 2.0.3] require npm-asset/bootstrap ^4.2 -> found npm-asset/bootstrap[v4.2.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4[2.0.4, ..., 2.0.10] require npm-asset/bootstrap ^4.3 -> found npm-asset/bootstrap[4.3.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4 ^2.0 -> satisfiable by yiisoft/yii2-bootstrap4[2.0.0, ..., 2.0.10].

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.

After this, i was run composer update, so everything will be with php 8 version. It was successful, but got this error with this command:

composer require yiisoft/yii2-bootstrap4
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - yiisoft/yii2-bootstrap4 2.0.0 requires npm-asset/bootstrap ~4.2 -> found npm-asset/bootstrap[v4.2.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4[2.0.1, ..., 2.0.3] require npm-asset/bootstrap ^4.2 -> found npm-asset/bootstrap[v4.2.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4[2.0.4, ..., 2.0.10] require npm-asset/bootstrap ^4.3 -> found npm-asset/bootstrap[4.3.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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-bootstrap4 ^2.0 -> satisfiable by yiisoft/yii2-bootstrap4[2.0.0, ..., 2.0.10].

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.

Also tried with "-W":

composer require yiisoft/yii2-bootstrap4 -W
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.1 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.2 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.3 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.4 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.5 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.6 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.7 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.8 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.9 (conflict analysis result)
    - Conclusion: don't install yiisoft/yii2-bootstrap4 2.0.10 (conflict analysis result)
    - yiisoft/yii-bootstrap5 3.0.x-dev is an alias of yiisoft/yii-bootstrap5 dev-master and thus requires it to be installed too.
    - Root composer.json requires yiisoft/yii2-bootstrap4 ^2.0 -> satisfiable by yiisoft/yii2-bootstrap4[2.0.0, ..., 2.0.10].
    - Conclusion: don't install npm-asset/bootstrap 4.6.0 (conflict analysis result)
    - Root composer.json requires yiisoft/yii-bootstrap5 ^3.0@dev -> satisfiable by yiisoft/yii-bootstrap5[3.0.x-dev (alias of dev-master)].
    - Conclusion: don't install npm-asset/bootstrap[4.5.2] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.5.1] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.5.0] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.4.1] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.4.0] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.3.1] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.3.0] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap[4.2.1] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)
    - Conclusion: don't install npm-asset/bootstrap 5.0.2 (conflict analysis result)
    - yiisoft/yii-bootstrap5 dev-master requires npm-asset/bootstrap ^5.0.0 -> satisfiable by npm-asset/bootstrap[5.0.0-alpha1, ..., 5.0.2].
    - You can only install one version of a package, so only one of these can be installed: npm-asset/bootstrap[v4.2.0, ..., 4.6.0, 5.0.0-alpha1, ..., 5.0.2].
    - yiisoft/yii2-bootstrap4 2.0.0 requires npm-asset/bootstrap ~4.2 -> satisfiable by npm-asset/bootstrap[v4.2.0, ..., 4.6.0].
    - Conclusion: don't install npm-asset/bootstrap[4.5.3] | install npm-asset/bootstrap[5.0.2] (conflict analysis result)

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
bizley commented 3 years ago

It looks like you don't have anything to handle installing NPM packages through Composer, is that correct? If so please refer to https://www.yiiframework.com/doc/guide/2.0/en/start-installation#installing-assets and https://www.yiiframework.com/doc/guide/2.0/en/structure-assets#bower-npm-assets

If that is not the case we need to look at this further.

sandor-molnar-vectorsolutions commented 3 years ago

@bizley sorry for late response. I don't think that's the case. I had npm installed to. I also installed bower just now with npm i -g bower, but i think that was uneeded. For me it looks like now i have conflict with bootstrap 5 and 4:

  Problem 1
    - yiisoft/yii2-bootstrap4 2.0.0 requires npm-asset/bootstrap ~4.2 -> found npm-asset/bootstrap[v4.2.0, ..., 4.6.0] but the package is fixed to 5.0.2 (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.
bizley commented 3 years ago

Yes, this is the case.

In order to prevent installation of B4 here add this in your composer.json:

"replace": {
    "yiisoft/yii2-bootstrap4": "*"
},

Hopefully it will work like that.

sandor-molnar-vectorsolutions commented 3 years ago

@bizley nah, found the problem. I wanted to use bootstrap 5, so i installed yiisoft/yii-bootstrap5. I decided to ignore bootstrap4 than, and i use bootstrap 5 in backend too. After a problem google search, found this: https://github.com/yiisoft/yii-bootstrap5/issues/44#issuecomment-809383229

bizley commented 3 years ago

We will have https://github.com/yiisoft/yii2-bootstrap5 soon.