Jump to content

ICT:Drupal Composer Commands

From Costa Sano MediaWiki
Command Description
composer --version Show the installed Composer version.
composer install Install all dependencies listed in composer.json (used after cloning a project).
composer update Update all dependencies to the latest allowed versions.
composer update drupal/core --with-all-dependencies Update Drupal core and all related packages.
composer require drupal/<module> Download and add a Drupal module to the project.
composer require drupal/<theme> Download and add a Drupal theme to the project.
composer remove drupal/<module> Remove a module from the codebase (does not uninstall it in Drupal).
composer show List all installed Composer packages.
composer show drupal/<package> Show details about a specific Drupal package.
composer outdated List packages with newer versions available.
composer validate Validate the composer.json file for syntax and structure.
composer dump-autoload -o Rebuild the autoloader with optimization (useful after file changes).
composer create-project drupal/recommended-project mysite Create a new Drupal project using the recommended template.
composer config Show or modify Composer configuration settings.
composer clear-cache Clear Composer’s internal cache.