Schogini is Magento2 ready. Are you?

Get started with Magento 2 | Need expert Magento2 support?

Magento 2 Composer Commands Explained


Category: Magento2

Case 1: First time usage or there is no composer.lock file present in the project’s folder

Case 1a: "composer install" command

Composer will read the composer.json file and install the dependencies as per the versions in it. And, creates composer.lock with the currently downloaded versions.

Case 1b: “composer update" command

Does same things as above.

Case 2: There is composer.lock file in the project’s folder

Case 2a: "composer install" command

Ignores the composer.json versions and loads the versions as per the composer.lock file. This is important when you need to transfer your project files to others/servers to ensure consistency.

Case 2b: “composer update" command

Ignores the composer.lock versions and loads the versions as per the composer.json file.

Case 3: Manual Installation of of just one package

To install a new package and only that, you have two options:

Case 3a: Add it manually to composer.json,then run:

composer update [package name]

Composer will add the package to your composer.json, install it, and add it to your composer.lock.

Case 3b: Use the require command, run:

composer require [package name]

to have composer guess the best version constraint to use

composer require [package name] ~2.5

to specify a version constraint explicitly

Composer will add the package to your composer.json, install it, and add it to your composer.lock.


 

Schogini's customer service extends beyond the natural boundaries. ~ Timothy Johnson

Schogini assures 24x7 - 6 hour turn around ticket response time and 24 hour Email response time (support@schogini.com)