We are getting ready to upgrade from v2.2.2 to v2.2.4. Due to our deployment process, I need to push the composer.json so it can be upgraded properly via the git rather than doing it in the backend.
But I just noticed that a second version number shows up in the top of the composer.json file. It currently shows our original version (2.2.1). Should this one be left alone to show the 'original' or should it be updated also?
{
 "name": "magento/project-community-edition",
 "description": "eCommerce Platform for Growth (Community Edition)",
 "type": "project",
 "version": "2.2.1",
 "license": [
 "OSL-3.0",
 "AFL-3.0"
 ],
 "require": {
 "magento/product-community-edition": "2.2.2",
 "composer/composer": "@alpha",
[.....]
- 
 You should mark the answer which helped you accepted.Vivek Kumar– Vivek Kumar2018年08月30日 22:59:42 +00:00Commented Aug 30, 2018 at 22:59
- 
 but I figured out the answer by re-running an upgrade on another instance. It wasn't an answer here that gave me the answer.Scott– Scott2018年08月31日 20:30:45 +00:00Commented Aug 31, 2018 at 20:30
- 
 Marking answer accepted helps other users which come looking for same issues, so either you can post your own answer and mark it as accepted or accept the answer which will solve the issue as acceptedVivek Kumar– Vivek Kumar2018年08月31日 20:33:37 +00:00Commented Aug 31, 2018 at 20:33
- 
 and I already added a comment that states what I did to solve the problem (which was different than the solution listed in the answer)Scott– Scott2018年09月05日 18:01:06 +00:00Commented Sep 5, 2018 at 18:01
2 Answers 2
This is what I use to upgrade:
How to update Magento2 using composer
Here is the solution that always works for me:
- composer require magento/product-community-edition 2.0.5 --no-update
- composer update
- rm -rf var/di var/generation
- php bin/magento cache:flush
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento indexer:reindex
- 
 ok, thanks - forgot I could run it that way to let composer do it. I had already updated one instance, but forgot that while my local copy isn't tied to a web server, it can work with composer. Doing that didn't update the top so I guess that answers that question.Scott– Scott2018年08月30日 18:09:20 +00:00Commented Aug 30, 2018 at 18:09
Ran composer manually - looked at header of composer.json. Version at the top didn't update.
Happy Vivek?