Contributing developers upgrade modules and extensions by specifying their versions in the Adobe Commerce or Magento Open Source composer.json
file. If you are not a contributing developer, see Perform an upgrade.
You can either add a require
section to the composer.json
file or you can use the composer require
command as follows:
Log in to your server.
Switch to the file system owner.
Change to the directory where you cloned the application. For example,
cd /var/www/magento2
You have the following options:
Command usage:
composer show --all <vendor>/<name>
For example:
composer show --all example/module
composer require
commandCommand usage:
composer require <vendor>/<name>:<version>
For example:
composer require example/module:1.0.0
Wait while Composer updates dependencies and installs the module.
require
section to the composer.json fileOpen the composer.json
in a text editor.
Add a require
section.
"require": {
"<vendor>/<name>": "<version>",
"<vendor>/<name>": "<version>"
}
Save your changes to the composer.json
file and exit the text editor.
Resolve dependencies and write exact versions to the composer.lock
file.
composer update