What should the content be in the Magento 2 root folder composer.json file AFTER Magento is installed? When I add a new module, should I add this to the existing list (require, etc)?
Should all the installed modules be listed here always?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
You don't exactly need to edit that file, but it will be modified and will reflect the installed modules yes, with the exception of local modules living in the app/code/ folder.
When you install new modules, you will use
composer require vendor/module, this will change the content of your composer.json file accordingly and regenerate the composer.lock with the last changes.
When installing the project (let's say, for deployment), you can use
composer install to read the composer.lock and fetch all your modules with the correct version.