0

I've created a contrib theme project page https://www.drupal.org/project/thisisme and pushed code to git.drupal.org and created releases.

But I can't get the module using composer require, e.g.

composer require drupal/thisisme

Gives:

./composer.json has been updated
Running composer update drupal/thisisme
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/thisisme, 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

I've also tried releases suffixes e.g.

composer require drupal/thisisme:1.0.x-dev

My minimum stablity is set to dev in composer.json

I've created a contrib module in the recent past and that has worked fine with composer require-ing it: https://www.drupal.org/project/smart_date_time_tbc/ and I am able to use that with composer require drupal/smart_date_time_tbc:1.0.x-dev .

Therefore, just having an identified development version seems to be enough to be able to use it in composer - which is evidenced here: https://www.drupal.org/project/smart_date_time_tbc/releases/1.0.x-dev and screenshot below:

Screen shot of dev release for smart_date_time_tbc showing compose require instructions

As an aside - my confusion about version numbering in different places (is this related to my problem)?

As an aside, I am a bit confused by why the versioning is in three places and with the possibility of differing version numbers, i.e.:

  1. in the thisisme.info.yml file we could have:

    version: 1.0

(or maybe even, anything we like?!)

  1. In git.drupal.org, the branch is 1.0.x

  2. And on the project page a created release is 1.0.x-dev, not 1.0.x - named after the branch name.

How does composer package manager "connect" to git.drupal.org such that composer require can fetch a drupal project, what does composer need to see?

Related research:

9
  • Try composer show -a drupal/thisisme, which will show available versions. If the package isn’t found, composer.json is missing the Drupal repository configuration or there is some other problem.
    – mona lisa
    Commented Aug 8 at 3:05
  • That project has only development versions, which are not considered stable enough from Composer. Creating a project release explains how to create project releases.
    – avpaderno
    Commented Aug 8 at 5:57
  • @avpaderno I have a development version for drupal.org/project/smart_date_time_tbc and I am able to use that with composer require drupal/smart_date_time_tbc:1.0.x-dev . Therefore, just having an identified development version seems to be enough to be able to use it in composer. I'll also update section about this in the question - I had outlined this but didn't detail the actual module involved. But I will look at [Creating a project release ](drupal.org/docs/develop/git/git-for-drupal-project-maintainers/…) to see if I've missed a step. Commented Aug 8 at 8:34
  • @monalisa when I try composer show -a drupal/thisisme I get: Authentication required (packages.drupal.org): - I'm unsure what user/password combination to give - one for drupal.org? Have you every tried this yourself for your projects, or indeed my example? What credentials did you give when asked the above? Commented Aug 8 at 9:51
  • drupal.org down at the moment, so can't try anything else yet. Commented Aug 8 at 10:15

1 Answer 1

0

The answer may be that I originally created thisisme as a distribution and then this week decided that most of the work being done is related to a theme. Also thinking about Drupal recipes as an upcoming trend. So I tried to commit just theme code to this project.

When I look at other distro pages, I see on them that there isn't a composer option too. This makes sense - one can't composer require a full Drupal distro into another full Drupal source!

1

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.