Composer require matching version : comment résoudre ce problème?
[InvalidArgumentException]
Could not find package directory/repository_name in a version matching "1.3" and a stability matching "dev".
Dans cet article on va rendre un module Drupal autonome qu'on pourra appeler dans un autre projet et hébergé sur Bitbucket.
Dans le composer.json du projet on ajoute l'adresse du repository.
"repositories": [
{
"type": "vcs",
"url": "git@bitbucket.org:directory/repository_name.git"
}
],
Dans le module on crée un fichier composer.json avec l'attribut version (ici la 1.3) :
{
"name": "directory/repository_name",
"version": "1.3",
"type": "drupal-custom-module",
"description": "Ma description",
"keywords": ["Drupal"],
"authors": [{
"name": "Julien Krier",
"homepage": "https://www.julienkrier.fr",
"role": "Maintainer"
}],
"homepage": "https://bitbucket.org/directory/repository_name",
"license": "proprietary",
"minimum-stability": "dev"
}
Ensuite on crée un tag de version sur le commit de notre branch. Ici je crée la version 1.3 en ajoutant le tag "v1.3".
Pour finir on lance notre composer require :
julien@lune:~~/Sites/test(master *)$ composer require directory/repository_name:1.3
./composer.json has been updated
Running composer update directory/repository_name
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking directory/repository_name (1.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Syncing directory/repository_name (1.3) into cache
- Installing directory/repository_name (1.3): Cloning c7b3ff2dc5 from cache
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
47 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
julien@lune:~~/Sites/test(master *)$
L'auteur de cet article
Cet article vous a aidé?