I am running my Drupal 8 project under Acquia Dev Desktop 2 and just got Composer installed. How can I add the Drupal Console to my project?
You should follow the docs on the official Drupal Console repo on how to install it with Composer. Note that the global launcher is not recommended, it is recommended to add it to your project through Composer.
# Change directory to Drupal site cd /path/to/drupal8.dev # Download DrupalConsole composer require drupal/console:~1.0 \ --prefer-dist \ --optimize-autoloader \ --sort-packages
Note that the second command is all one command, not four. The
\ tells terminal the command is continuing to the next line.
you can install
drupal console using
open the command line on windows then go to :
now you can install
drupal console :
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
after that you installed
drupal console you can use it from drupal root directory where composer.json exist as follow:
you should replace
<the_command> with one of the
drupal console commands. you can see complete list of the commands here: drupal console commands