3

On a Magento 2 branch, when I am running the composer will get different module versions than the required one. Let's say for the Magento_Store module I do need the 2.0.0 version, but the composer is installing the 2.1.0 version.

So after a succesful install when I am trying to access the website, I am getting error messages for both schema_version and data_version for lot's of modules.

Example:

Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. 
The following modules are outdated:
Magento_Store schema: current version - 2.1.0, required version - 2.0.0
Magento_Store data: current version - 2.1.0, required version - 2.0.0
Magento_Directory schema: current version - 2.0.1, required version - 2.0.0
Magento_Directory data: current version - 2.0.1, required version - 2.0.0

And the list is very long! Only part of it has been copied above.

Until now, I was trying to modify the version number in the setup_module table from database, but no luck. Before that, I was running the bin/magento setup:upgrade command and also cleared the cache but I had the feeling I'm in a loop and always got back to the same error list. So, I guess my aproach was wrong.

Is there a solution to set up the right way the composer in order to avoid in future such problems? Or what should be the direction to aproach?

2

composer install latest available version, that compatible with all your requirements.

You can manually add required version in your composer.json "magento/module-store": "100.1" (it's for magento 2.1.*)

  • You mean in vendor/magento/composer/composer.json ? – Grávuj Miklós Henrich May 14 '18 at 17:10
  • No, composer.json file in magento root directory. – Alex May 15 '18 at 6:06
  • I have defined the required versions for modules in the composer.json but it is still installing the latest available versions. – Grávuj Miklós Henrich May 15 '18 at 8:27
0

Make sure you added the right requirements in composer.json (As stated by Alex before) and make sure to update the composer.lock by executing composer update magento/module-store to update the data for the omitted module or composer update to update all modules according to the requirements in composer.json.

  • prntscr.com/ji8no1 this way is okay? – Grávuj Miklós Henrich May 15 '18 at 16:45
  • @GrávujMiklósHenrich that would make sure only version 2.0.0 would be used for these modules. Don't forget to use composer update magento/module-store magento/module-directory after you edited the composer.json – muhkuh2005 Oct 19 '18 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.