3

I have a module that relies on swiftmailer, and needs the libraries installed. Whenever I've needed to install swiftmailer libraries to a Drupal environment, I've always run this command:

composer require drupal/swiftmailer

This no longer seems to work. Running this now prompts me for authentication to git.drupal.org, and I don't understand why. Apparently this isn't the same as my drupal.org credentials:

screenshot

I'm not extremely familiar with Composer and am wondering what I can do here.

5
  • Would be better to paste the terminal output as blockquote into your question instead of attaching it as a screenshot. For readability and searchability.
    – leymannx
    Jul 25, 2018 at 20:49
  • 1
    try composer require 'drupal/swiftmailer:^1.0'
    – No Sssweat
    Jul 26, 2018 at 1:18
  • It looks like it's the coder module that's causing the problem, trying to fetch it from a non-standard repository. Are you using a customised/patched version of that module? Jul 26, 2018 at 9:18
  • 1
    As far as I know I'm not using a custom or patched version. Thanks @NoSssweat, your comment worked for me.
    – saramm1
    Jul 26, 2018 at 12:45
  • Puzzling, but good news you got it sorted. Jul 26, 2018 at 13:32

2 Answers 2

1

I know you're sorted now, but wanted to suggest that this could be because the repository URL for the coder module is using https.

See here:

https://help.github.com/articles/why-is-git-always-asking-for-my-password/

The link at the bottom of that article suggests that you can cache your credentials to avoid the need to enter them when using https:

https://help.github.com/articles/caching-your-github-password-in-git/

(I would have commented rather than answered, but it seems I don't have enough reputation to comment yet!)

1

The problem seems to be caused by the server git.drupal.org not responding. Excerpt from the posted composer output:

Could not resolve host: git.drupal.org; Name or service not known

I wonder if the reason it suddenly worked again, might be as simple as the server responding again.

The interesting part of this problem is why drupal/coder is installed/updated at all (when requiring drupal/swiftmailer) ... It's not Swiftmailer that requires Coder. Added: If you used "drupal-composer/drupal-project" as your starting point, Coder is required through webflo/drupal-core-require-dev. The question then becomes, why did Composer update Coder when you just required Swiftmailer? (That is a Composer issue.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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