Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in

Breadcrumb

  1. Home

Composer

By admin, 21 August, 2025

How and Why to Use --prefer-dist in Composer for Drupal Projects

Introduction:
When working on Drupal projects, installing and updating dependencies is a crucial step. All external modules and libraries are managed using Composer. The --prefer-dist option helps speed up this process and ensures more stable installations.


What --prefer-dist Does

Composer can fetch packages in two ways:

Tags

  • #Drupal Planet
  • Composer
By admin, 3 April, 2024

Installing Drupal Modules with Composer

The command

composer require drupal/module_name

is used in Drupal to install a new module or package into your Drupal project using Composer.

 

Here, `drupal/module_name` should be replaced with the actual name of the module you want to install. For example, if you want to install the "Views" module, the command would be:

Tags

  • #Drupal Planet
  • Composer
By admin, 3 April, 2024

Understanding "composer update --dry-run" Command

The command `composer update --dry-run` is used to perform the process of updating dependencies in a project, but without actually changing any files or installing updates. The `--dry-run` option (or `-n`) instructs Composer to simulate the update, showing which packages will be updated without making actual changes to the `composer.json` files or installing updates.

Tags

  • Composer
  • #Drupal Planet
Composer
Powered by Drupal