-1

Trying to use any drush command I get an error saying autoload.php won't load. It's in the vendor folder which is in the web root where I'm pretty sure it's supposed to be. It also has chmod +x permissions. If I put in php composer.phar I get the version and all that so yes it is there. If I run composer drupal-update (which composer manager would like for me to do) bash says composer: command not found. Is composer the only way to do this library thing in drupal 8? It seems a lot more problematic and less user friendly than just putting a library directory in the sites folder.

  • I think that a common use case is to install drush outside of the Drupal webroot (for instance in ~/ or globally). – mradcliffe Mar 28 '16 at 17:39
1

If you are getting the error -bash: composer: command not found, that means Composer is not in the PATH Bash is using.

To use the Composer Manager module, you don't necessarily need Drush. I use it without Drush, but I run the following commands after I install the module.

cd <root directory of Drupal 8>
php modules/composer_manager/scripts/init.php

If all works fine, you will see the following output:

Composer Manager has been successfully initialized.

In this way, the Composer Manager module adds a new command inside the composer.json file used by Drupal. In fact, after running those command, you will notice the following lines inside the composer.json file.

"drupal-rebuild": "Drupal\\composer_manager\\Composer\\Command::rebuild",
"drupal-update": "Drupal\\composer_manager\\Composer\\Command::update"

In the case you didn't execute those commands, or they failed for any reason, running composer drupal-update would return the following error:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "drupal-update" is not defined.

 

If you are downloading modules using Drush, just do as you normally do. The Composer Manager module will hook into Drush and do its task when a new module is downloaded.

  • well I actually already did that but ok I'll do it again. Yeah, same thing. it says composer manager has been successfully initialized but then when i run composer drupal-update it still says -bash: composer: command not found. – Ed523 Mar 29 '16 at 16:40
  • Are you sure composer is in the bash PATH? – kiamlaluno Mar 29 '16 at 18:48
  • 1
    Composer is definitely not installed. Refer to the instructions at getcomposer.org/doc/00-intro.md#installation-linux-unix-osx. – Bojan Zivanovic Mar 29 '16 at 23:19
  • After running php modules/composer_manager/scripts/init.php I had to run composer update before running composer drupal-update. If I skipped the second step, I got the Symfony error reported by kiamlaluno. – foray Jul 15 '16 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.