Problem installing fontawesome library via composer

Created on 28 June 2023, over 1 year ago
Updated 9 July 2024, 6 months ago

I'm attempting to install FontAwesome and have it install the fontawesome library with Composer as described in 8.x-2.x-dev README.md. My plan is to use the local version of the library, not CDN.

I used:
composer require 'drupal/fontawesome:2.x-dev@dev'

Then edited my composer.json file to include the "extra" section, and ran composer update --lock. It said, "Nothing to modify in lock file," and "Nothing to install, update or remove." No library installed under web/libraries.

I tried:
composer update drupal/fontawesome --with-all-dependencies

And got:
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires fontawesome/fontawesome 6.4.0 -> satisfiable by fontawesome/fontawesome[6.4.0].
- fontawesome/fontawesome 6.4.0 requires composer/installers ^1.2.0 -> found composer/installers[v1.2.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.0).

In my root composer.json, "composer/installers": "^2.0" is coming from starting the project with drupal/recommended-project.

Is there something else I should be doing to get the library to install?

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States sclsweb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sclsweb
  • 🇫🇷France mably

    Can be fixed by adding ||^2.0 in the composer.librairies.json require section:

            "require": {
              "composer/installers": "^1.2.0||^2.0"
            }
  • 🇮🇳India sumit-k

    Replicated the same issue. #3 solution is working fine, adding a patch for the same changes.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Dheeraj Jhamtani Jaipur, Rajasthan

    Hi @mably , which version of drupal you are using because i am not getting this error at my end with drupal 10

  • Status changed to Fixed over 1 year ago
  • 🇺🇸United States daniel.moberly

    Committed. Thank you!

  • 🇫🇷France mably

    @dheeraj-jhamtani I was on latest Drupal 10.1 I think.

    I hade the problem because I have a custom composer configuration using merge-plugin that adds all dependencies it can find for every module existing composer.libraries.json file.

    Something looking like this:

        "extra": {
            "merge-plugin": {
                "include": [
                    "web/modules/contrib/*/composer.libraries.json",
                    "web/modules/custom/*/composer.libraries.json",

    No error without this specific configuration as, by default, composer won't parse the composer.libraries.json file.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇺🇸United States sbubaron

    Having same issue but now with composer/installers v2.2:

    Your requirements could not be resolved to an installable set of packages.

    Problem 1
    - Root composer.json requires fontawesome/fontawesome 6.4.0 -> satisfiable by fontawesome/fontawesome[6.4.0].
    - fontawesome/fontawesome 6.4.0 requires composer/installers ^1.2.0 -> found composer/installers[v1.2.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).

    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

  • Status changed to Fixed 12 months ago
  • 🇵🇰Pakistan noman_297

    Having same issue patch in #4 is not applying on Drpual 10.2.0

  • 🇮🇳India arisen Goa

    Any plans of having this fix in the release soon?
    Thanks

Production build 0.71.5 2024