Fix composer.libraries.json

Created on 23 April 2025, 1 day ago

Problem/Motivation

I tried to add the library repository in the composer.json file:

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
              "name": "rubentd/gifplayer",
              "version": "dev-master",
              "type": "drupal-library",
              "extra": {
                "installer-name": "gifplayer"
              },
              "dist": {
                "url": "https://github.com/rubentd/gifplayer/archive/refs/tags/0.3.7.tar.gz",
                "type": "zip"
              },
              "license": "MIT"
            }
          }
    ],

And I got this error when trying to download the library:

$composer require gifplayer/gifplayer
In PackageDiscoveryTrait.php line 383:
                                                                                                                                                                                                           
  Could not find a matching version of package gifplayer/gifplayer. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stabi  
  lity (dev).                                                                                                                                                                                              
                                                                                                                                                                                                           

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

Steps to reproduce

Add the repository from the file composer.libraries.json in the composer.json and run

$composer require gifplayer/gifplayer

Proposed resolution

Fix the composer.libraries.json for both branches.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada danrod Ottawa

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

Merge Requests

Comments & Activities

  • Issue created by @danrod
  • 🇨🇦Canada danrod Ottawa
  • 🇨🇦Canada danrod Ottawa
  • 🇨🇦Canada danrod Ottawa
  • 🇨🇦Canada danrod Ottawa

    I also changed the installer from tar.gz to zip and it seems to work now:

    ddev composer require "rubentd/gifplayer"
    ./composer.json has been updated
    Running composer update rubentd/gifplayer
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 1 install, 0 updates, 0 removals
      - Locking rubentd/gifplayer (0.3.7)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Installing rubentd/gifplayer (0.3.7): Extracting archive
    Generating autoload files
    98 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    phpstan/extension-installer: Extensions installed
    No security vulnerability advisories found.
    Using version ^0.3.7 for rubentd/gifplayer
    
  • 🇨🇦Canada danrod Ottawa

    I also made the same fix in the 8.x-1.x branch.

    I think I'm ready to create two tagged releases after fixing a lot of issues with the module, will do that tomorrow. Closing this to "Fixed"

  • 🇨🇦Canada danrod Ottawa
Production build 0.71.5 2024