yireo / magento2-replace-all

Meta-package to replace all optional Magento 2 modules
129 stars 32 forks source link

Error installing for Magento 2.3.5-p1 #14

Closed nix0x00 closed 4 years ago

nix0x00 commented 4 years ago

I am running Magento 2.3.5-p1, and so I tried to install for version 2.3.5.1-p1, which gives me error.

" Could not find package yireo/magento2-replace-all in a version matching 2.3.5.1-p1 "

All the below give error except "2.3.5".

  • 2.3.5.1-p1
  • 2.3.5.1
  • 2.3.5-p1

And so I changed it to 2.3.5, which worked. But then it gives me error:

$ composer require yireo/magento2-replace-all:2.3.5
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.5
    - don't install yireo/magento2-replace-all 2.3.5|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.5|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all 2.3.5 -> satisfiable by yireo/magento2-replace-all[2.3.5].
    - Installation request for yotpo/magento2-module-yotpo-reviews-bundle (locked at 3.1.0) -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].

So I removed Yotpo and ran it again.

$ bin/magento module:disable Yotpo_Yotpo --clear-static-content
$ ...
$ composer require yireo/magento2-replace-all:2.3.5
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.5
    - don't install yireo/magento2-replace-all 2.3.5|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.5|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all 2.3.5 -> satisfiable by yireo/magento2-replace-all[2.3.5].
    - Installation request for yotpo/magento2-module-yotpo-reviews-bundle (locked at 3.1.0) -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].

UPDATE:

I copied the content of replace from "composer.json" and pasted to my composer.json, and ran "composer update". which gave me following error:

[InvalidArgumentException]
  Package is not installed: magento/project-community-edition-2.3.5.0-patch1
jissereitsma commented 4 years ago

There's no release 2.3.5-p1 for this package. For the latest releases, see https://github.com/yireo/magento2-replace-all/releases

Could you see the Troubleshooting section here? https://github.com/yireo/magento2-replace-tools/blob/master/README.md

nix0x00 commented 4 years ago

There's no release 2.3.5-p1 for this package. For the latest releases, see https://github.com/yireo/magento2-replace-all/releases

Could you see the Troubleshooting section here? https://github.com/yireo/magento2-replace-tools/blob/master/README.md

Yes, i know that is why its confusing, that there is no such package 2.3.5 or 2.3.5-p1, but i see 2.3.5.1-p1 though:

However, composer can't find this version.

I am unable to install it on Magento 2.3.5-p1, I have tried troubleshooting as well.

Problem 1
    - Conclusion: don't install yireo/magento2-replace-all 2.3.2
    - Conclusion: don't install yireo/magento2-replace-all 2.3.1
    - Conclusion: remove magento/product-community-edition 2.3.5-p1
    - Conclusion: don't install magento/product-community-edition 2.3.5-p1
    - Conclusion: don't install yireo/magento2-replace-all 2.3.5
    - Installation request for vertex/sdk (locked at 1.2.2) -> satisfiable by vertex/sdk[1.2.2].
    - Installation request for magento/product-community-edition 2.3.5-p1 -> satisfiable by magento/product-community-edition[2.3.5-p1].
    - Conclusion: don't install yireo/magento2-replace-all 2.3.4
    - magento/product-community-edition 2.3.5-p1 requires yotpo/magento2-module-yotpo-reviews-bundle 3.1.0 -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.3
    - don't install yireo/magento2-replace-all 2.3.3|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.3|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all ^2.3 -> satisfiable by yireo/magento2-replace-all[2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5].

Installation failed, reverting ./composer.json to its original content.
jissereitsma commented 4 years ago

The current releases should be working now - for instance https://github.com/yireo/magento2-replace-all/releases/tag/2.3.5-p1 (2.3.5-p1). Also, I worked on setting up CI testing, so that every change in the replacements is guaranteed to be working: https://github.com/yireo/magento2-replace-all/actions/runs/169968834 The tests run fine, so I assume this fixes things for you too. Let me know if that's not the case.

nix0x00 commented 4 years ago

Hey Jisse, Below is the output.

-bash-4.2$ composer require yireo/magento2-replace-all:2.3.5-p1 --ignore-platform-reqs
    1/1:        http://repo.packagist.org/p/provider-latest$dfb18cd5860a8ea0f247ec9c5422d7ba82f80577b2e1c009d824d3166338280f.json
    Finished: success: 1, skipped: 0, failure: 0, total: 1
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.5-p1
    - don't install yireo/magento2-replace-all 2.3.5-p1|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.5-p1|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all 2.3.5-p1 -> satisfiable by yireo/magento2-replace-all[2.3.5-p1].
    - Installation request for yotpo/magento2-module-yotpo-reviews-bundle (locked at 3.1.0) -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].

Installation failed, reverting ./composer.json to its original content.

So I executed with no-update.

-bash-4.2$ composer require --no-update yireo/magento2-replace-all:2.3.5-p1 --ignore-platform-reqs
    1/5:        http://repo.packagist.org/p/provider-latest$53efb89367af3ee823a15b3abd4ea6f8d8cbc4a21c758745437d6d798d1f12cc.json
    2/5:        http://repo.packagist.org/p/provider-2020-01$91146ad5f251e35aaa43cf9be32631887b0ddeda0158e17fd576cce2b5798a1d.json
    4/5:        http://repo.packagist.org/p/provider-2020-04$9e0f97107e39cb711f74583bb56cfa846b6eae4fab59085739f23fb10d0af08a.json
    4/5:        http://repo.packagist.org/p/provider-2017$c55037c689c86c4f9a72df77d0d08792d08fe93501c4e1229ad9ef93b951d46c.json
    5/5:        http://repo.packagist.org/p/provider-2019$cf5b00aa69255d07687e158fede411d8541b4c739a0df22c1628b166ae42afc4.json
    Finished: success: 5, skipped: 0, failure: 0, total: 5
./composer.json has been updated

-bash-4.2$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - olegnax/module-core 1.0.11 requires php ~7.1.3||~7.2.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - olegnax/module-core 1.0.11 requires php ~7.1.3||~7.2.0 -> your PHP version (7.3.19) does not satisfy that requirement.
    - Installation request for olegnax/module-core 1.0.11 -> satisfiable by olegnax/module-core[1.0.11].

Then I executed it with --ignore-platform-reqs.

-bash-4.2$ composer install --ignore-platform-reqs
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
55 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../codeception,../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility

In the above logs, notice Nothing to install or update. I am not sure if this module worked or not. So I updated as it said in order to sync the lock file.

-bash-4.2$ composer update --ignore-platform-reqs
    1/5:        http://repo.packagist.org/p/provider-latest$403fd3adec0d351c92afc833f4307b94e31d2312bdc72eb57030241d23680c4c.json
    2/5:        http://repo.packagist.org/p/provider-2019-10$d1a3332f540c136f75bfab9a817d882625f720b02d0c3b9ae4c56075021c55f7.json
    3/5:        http://repo.packagist.org/p/provider-2020-01$af938360081cf65e2d544ca1ffb0c992d1f9c835dfaa6c9a815284d7e78c1f42.json
    4/5:        http://repo.packagist.org/p/provider-2020-04$b2fa82e8f7b86b1011e90dd2a56c926413a53cb89027c004ff0e22bc0390b2c4.json
    5/5:        http://repo.packagist.org/p/provider-2018$90da910dfef2f48e3bf46bfa6aba78956ccf778fb40f7246f040752d35985c76.json
    Finished: success: 5, skipped: 0, failure: 0, total: 5
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yireo/magento2-replace-inventory 2.3.5-p1|don't install yireo/magento2-replace-all 2.3.5-p1
    - don't install yireo/magento2-replace-all 2.3.5-p1|remove yireo/magento2-replace-inventory 2.3.5-p1
    - Installation request for yireo/magento2-replace-all 2.3.5-p1 -> satisfiable by yireo/magento2-replace-all[2.3.5-p1].
    - Installation request for yireo/magento2-replace-inventory 2.3.5-p1 -> satisfiable by yireo/magento2-replace-inventory[2.3.5-p1].

So, I believe it was not installed. However, your MSI module gets installed perfectly, I do have following in ~/vendor/

-bash-4.2$ ls vendor/yireo/
magento2-replace-inventory
nix0x00 commented 4 years ago

Maybe I am thinking that some of few modules list to be removed are no longer in 2.3.5-p1? or perhaps they changed their directory/name ?

jissereitsma commented 4 years ago

That's not the case. In my development environment, this is working just fine. It seems to have to do with the ordering in which Magento modules are resolved. Strangely, the same replacements in the yireo/magento2-replace-bundled package work just fine.

Could you try to add the repository first to your composer configuration and then re-run the commands?

composer config repositories.magento2-replace-all vcs git@github.com:yireo/magento2-replace-all.git
nix0x00 commented 4 years ago

Hi, Below the result now.

-bash-4.2$ composer config repositories.magento2-replace-all vcs git@github.com:yireo/magento2-replace-all.git
-bash-4.2$ composer require yireo/magento2-replace-all:2.3.5-p1 --ignore-platform-reqs
    1/13:       http://repo.packagist.org/p/provider-archived$04cf8382da4a87202802e2996efe081eb6961ee01da9fdee71ce2f5a79a916b3.json
    2/13:       http://repo.packagist.org/p/provider-latest$4175a623dcc468e1f6ba4dfa27ae3f25ff5ab4b9dc003d009a58c463e4e40b98.json
    3/13:       http://repo.packagist.org/p/provider-2020-07$9cb5aacf58af14fa989d0e4a2826c5b5c9d2cddfc2a6a1ce6d9519e37d2cf267.json
    4/13:       http://repo.packagist.org/p/provider-2020-04$a1f094b922996d4a7fd28acbe157e59ebb53e52a09d3c8f1fc4a9b75aef47435.json
    5/13:       http://repo.packagist.org/p/provider-2019-10$7786bfab128a13f94b04130c1e20c2a6ea73964616214a50da2a93634f8a2b8f.json
    7/13:       http://repo.packagist.org/p/provider-2015$b88d5c4df91ca896464ce54dbecefc7134854f605b5110fbadf84ed124e83072.json
    7/13:       http://repo.packagist.org/p/provider-2013$6e394f053360c25706360330a8e31641de2baea75f98cd4a682b1ae9003136ec.json
    8/13:       http://repo.packagist.org/p/provider-2018$b02a0a75e06f13194ceb2d53722a66007408ee075e00bd673083184006dbc88d.json
    9/13:       http://repo.packagist.org/p/provider-2014$86b5acdb5e8ae6935382bccd0ed02505ccd0206e527f3b70dd517b630f496972.json
    10/13:      http://repo.packagist.org/p/provider-2020-01$2ccd08c9bd9adf50855a555c9faba4c5b6478e1fa7257de1d97161647aca5b15.json
    11/13:      http://repo.packagist.org/p/provider-2016$2b047641f97950158493b7aaa62741561de7bbe94fbfbb2a56ccb208172183e8.json
    12/13:      http://repo.packagist.org/p/provider-2017$28432b8ebdef37fdf00c97b182157cc5a2a2f2ff1f4eccb85711e0132faee60d.json
    13/13:      http://repo.packagist.org/p/provider-2019$c7d207a178a29b5f7dca91f6f76f1c890a4222d94a4d6d66d5cc78548044c24d.json
    Finished: success: 13, skipped: 0, failure: 0, total: 13
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.5-p1
    - don't install yireo/magento2-replace-all 2.3.5-p1|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.5-p1|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all 2.3.5-p1 -> satisfiable by yireo/magento2-replace-all[2.3.5-p1].
    - Installation request for yotpo/magento2-module-yotpo-reviews-bundle (locked at 3.1.0) -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].

Installation failed, reverting ./composer.json to its original content.
-bash-4.2$  

Can you please guide me to install it manually? instead of composer. I am confused as yireo/magento2-replace-inventory was installed perfectly. But replace2-all is just giving errors.

jissereitsma commented 4 years ago

Simply review the composer.json and add its replace section to your composer.json file. And then test what works.

jissereitsma commented 4 years ago

Could you comment on what you mean with that the yireo/magento2-replace-inventory is already installed? Are you installing yireo/magento2-replace-all on top of yireo/magento2-replace-inventory?

nix0x00 commented 4 years ago

I mean, I installed this package magento2-replace-inventory to remove additional MSI modules. Then I wanted to install yireo/magento2-replace-all this package to remove removes all packages listed in the other directories.

jissereitsma commented 4 years ago

No, the package yireo/magento2-replace-all replaces things that also include entries from yireo/magento2-replace-inventory. And it naturally leads to conflicts if you are trying to install boths, because if a package is duplicated in both repositories, you are trying to remove something that has already been removed. As soon as you have decided to use the yireo/magento2-replace-all package (which replaces all), remove the yireo/magento2-replace-inventory first.

jissereitsma commented 4 years ago

See the contents of both composer.json as a reference, so you understand what you are trying to do. Note that this entire approach requires you to study how composer works. Let me know once you have removed one of the two and tried the suggestions above again. Please also note that if you want to do everything manually, removing all replace-packages are a must. In short, only use one approach to replace something, do not replace multiple approaches at once.

nix0x00 commented 4 years ago

I don't think thats the issue. Because I removed the first package as shown below.

-bash-4.2$ composer remove yireo/magento2-replace-inventory --ignore-platform-reqs
Dependency "magento/product-community-edition" is also a root requirement, but is not explicitly allowed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
56 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../phpcompatibility/php-compatibility,../../codeception,../../magento/magento-coding-standard

.

I installed replace2-all and same error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0|don't install yireo/magento2-replace-all 2.3.5-p1
    - don't install yireo/magento2-replace-all 2.3.5-p1|remove yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - don't install yireo/magento2-replace-all 2.3.5-p1|don't install yotpo/magento2-module-yotpo-reviews-bundle 3.1.0
    - Installation request for yireo/magento2-replace-all 2.3.5-p1 -> satisfiable by yireo/magento2-replace-all[2.3.5-p1].
    - Installation request for yotpo/magento2-module-yotpo-reviews-bundle (locked at 3.1.0) -> satisfiable by yotpo/magento2-module-yotpo-reviews-bundle[3.1.0].
Installation failed, reverting ./composer.json to its original content.

I will now try to add composer.json modules in replace block (10 by 10 i.e. not all together) manually. and then composer update. see if that works, and I shall let you know.

nix0x00 commented 4 years ago

I add the modules from composer.json to the <magento root>/composer.json "replace" block, and did composer update. and it removed all the modules. So, it worked.

@jissereitsma Albeit, i have a question. After this as my site was throwing exception on the frontend, I did setup:di:compile. And when I executed module:status I could see those modules such as Yotpo, which I had removed from composer.json.

So were these modules installed again? or its a reference in module:status and I can ignore it?

jissereitsma commented 4 years ago

A module is installed, so simple review your vendor folder for packages. A module is registered in app/etc/config.php so simply remove the entry there if the module is no longer in vendor. Also, it is obvious that after changing the code, a setup:di:compile is needed (and a static content deployment and a cache flush). Please note that this is not related to this replacement-package, but simply to administering a Magento site. I'll close this ticket for now, because at least the replacements seem to be working now.