Drupal 10 version not installable through Composer

Created on 15 March 2023, over 1 year ago
Updated 27 July 2024, 4 months ago

I am receiving errors when attempting to install this module via Composer. I followed the library instructions (https://git.drupalcode.org/project/lightgallery/-/blob/8.x-1.x/README.md), but the module is still uninstallable. What makes this module so different/difficult from others, and how can I install it on my new D10 website?

composer require drupal/lightgallery


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

  Problem 1
    - drupal/lightgallery[1.0.0-beta1, ..., 1.1.0] require drupal/core ^8 -> found drupal/core[8.0.0-beta6, ..., 8.9.20] but the package is fixed to 10.0.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/lightgallery 1.2.0 requires drupal/core ^8 || ^9 -> found drupal/core[8.0.0-beta6, ..., 8.9.20, 9.0.0-alpha1, ..., 9.5.5] but the package is fixed to 10.0.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/lightgallery 1.3.0 requires drupal/core ^9 -> found drupal/core[9.0.0-alpha1, ..., 9.5.5] but the package is fixed to 10.0.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/lightgallery 1.4.0 requires sachinchoolur/lightgallery ^1.2.21 -> could not be found in any version, there may be a typo in the package name.
    - Root composer.json requires drupal/lightgallery * -> satisfiable by drupal/lightgallery[1.0.0-beta1, ..., 1.4.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

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

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

I also tried these composer commands, all of which resulted in the same errors:
composer require 'drupal/lightgallery:^1.4'
composer require 'drupal/lightgallery:1.x-dev@dev'

πŸ› Bug report
Status

Fixed

Version

1.4

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States hockey2112

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

Merge Requests

Comments & Activities

  • Issue created by @hockey2112
  • πŸ‡ΊπŸ‡ΈUnited States hockey2112
  • πŸ‡§πŸ‡ͺBelgium mgstables

    In composer.json:

        "require": {
            "php": ">=7.0 || >=8.0",
            "drupal/core": "^9 || ^10",
            "sachinchoolur/lightgallery": "^1.2.21"
        }
    

    I think it should be:
    sachinchoolur/lightGallery

        "require": {
            "php": ">=7.0 || >=8.0",
            "drupal/core": "^9 || ^10",
            "sachinchoolur/lightGallery": "^1.2.21"
        }
    
  • πŸ‡¦πŸ‡ΉAustria dv@blinker.digital

    I get the following error when trying to include sachinchoolur/lightGallery :

      Problem 1
        - Root composer.json requires drupal/lightgallery ^1.4 -> satisfiable by drupal/lightgallery[1.4.0, 1.x-dev].
        - drupal/lightgallery[1.4.0, ..., 1.x-dev] require sachinchoolur/lightgallery ^1.2.21 -> could not be found in any version, there may be a typo in the package name.
    

    Somewhere there's a typo and it's interfering with dependencies.

  • πŸ‡¨πŸ‡¦Canada jglynn

    I have same problem installing with composer

  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡¦Ukraine paulrad

    The issue is caused by the fact that sachinchoolur/lightGallery library is not being considered as a package.
    To resolve it - you need to install the library first and then proceed to the module installation.

    Patch with updates on the installation process in the README.md applied.

    Here's the console results after proposed resolution:

    $ composer require 'drupal/lightgallery:^1.4'
    ./composer.json has been updated
    Running composer update drupal/lightgallery
    Gathering patches for root package.
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 1 install, 0 updates, 0 removals
      - Locking drupal/lightgallery (1.4.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/lightgallery (1.4.0): Extracting archive
    Generating autoload files
    90 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    phpstan/extension-installer: Extensions installed
  • πŸ‡§πŸ‡ͺBelgium mgstables

    Same problem, "sachinchoolur/lightgallery" cannot be found by composer

    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires sachinchoolur/lightgallery, it could not be found in any version, there may be a typo in the package name.
    
    Potential causes:
     - A typo in the package name
     - The package is not available in a stable-enough version according to your minimum-stability setting
       see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
     - It's a private package and you forgot to add a custom repository to find it
    
    Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
    
    

    If I change to "sachinchoolur/lightGallery" then composer has a problem with the uppercase letter.

      require.sachinchoolur/lightGallery is invalid, it should not contain upperc
      ase characters. Please use sachinchoolur/lightgallery instead.
    

    You can only install the "light gallery plugin" manually and therefore it is best to extract it from the "required" in the composer.json file supplied with the module.

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I don't think the new instructions in the patch are right.

    The sachinchoolur/lightgallery package does not need to be installed first, but you need to have the repository defined in your root composer.json so composer can find it when installing drupal/lightgallery.

    The lightgallery module requires "sachinchoolur/lightgallery": "^1.2.21", which is the latest 1.2 release.

    This version is way behind, but probably the one to stick to unless later versions have been tested.

    The readme has notes for adding the repository, but the version is wrong.

    If you add the repository to your composer.json with version 1.2.21, it works.

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "sachinchoolur/lightgallery",
                "version": "<strong>1.10.0</strong>",
                "type": "drupal-library",
                "source": {
                    "url": "https://github.com/sachinchoolur/lightGallery",
                    "type": "git",
                    "reference": "<strong>1.10.0</strong>"
                }
            }
        }
    ]
    

    I think the best way to handle this is to add the repository to the composer.json. Is that not allowed?

    If not, just updating the readme instructions with the version number is a big help.

  • Merge request !17Update readme β†’ (Open) created by mortona2k
  • πŸ‡ΊπŸ‡¦Ukraine vasyok

    Thanks, mortona2k!
    change

    "repositories": [{
            "type": "composer",
            "url": "https://packages.drupal.org/8"
    }],
    

    to

    "repositories": [{
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            {
                "type": "package",
                "package": {
                    "name": "sachinchoolur/lightgallery",
                    "version": "1.2.21",
                    "type": "drupal-library",
                    "source": {
                        "url": "https://github.com/sachinchoolur/lightGallery",
                        "type": "git",
                        "reference": "1.2.21"
                    }
                }
            }
        ],

    then command
    composer require 'drupal/lightgallery:^1.4'
    work properly

  • πŸ‡§πŸ‡ͺBelgium ehanuise

    Had the same issue, solved by adding VasyOK's changes to the composer.json.

  • πŸ‡¨πŸ‡­Switzerland titouille

    Thanks @VasyOK for the tip, working perfectly.

  • Status changed to RTBC 4 months ago
  • πŸ‡§πŸ‡·Brazil murilohp

    Thanks for the explanation @mortona2k and for the documentation! @paulrad, thanks for the patch, but as pointed by @mortana2k, you just need the package defined on your repositories section.

    • murilohp β†’ committed 5666f793 on 8.x-1.x
      Issue #3348302 by mortona2k, murilohp: Drupal 10 version not installable...
  • Status changed to Fixed 4 months ago
  • πŸ‡§πŸ‡·Brazil murilohp

    Reviewed and commited the changes to the README.md, thank you all!

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

Production build 0.71.5 2024