0

I am trying to download this install profile https://github.com/UH-StudentServices/student_guide

I added it to composer.json like this

"repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "vcs",
            "url": "git@github.com:UH-StudentServices/student_guide.git"
        }
    ],

Then I did composer require and I got following error

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

  Problem 1
    - Root composer.json requires uh-studentservices/student_guide ^1.62 -> satisfiable by uh-studentservices/student_guide[v1.62].
    - uh-studentservices/student_guide v1.62 requires drupal/block_access dev-8.x-1.x#1cd59ba6856c897afae2551feaa8e6b7f312489c -> found drupal/block_access[dev-1.x, 1.0.0-alpha1, 1.0.0-beta1, 1.x-dev (alias of dev-1.x)] but it does not match the constraint.

I know that the module version should be dev-1.x and not dev-8.x-1.x. I am wondering what should I do. May be I can clone the install profile and edit the composer.json, but How can I include it in composer.json locally?

1 Answer 1

1

It is necessary to add to the repositories key in composer.json all of the repositories specified by the project because it seems some are not registered with Packagist.

"repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org/"
        },
        {
            "type": "vcs",
            "url": "https://github.com/larowlan/block_access"
        },
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
                "name": "rubaxa/sortable",
                "version": "v1.4.0",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/RubaXa/Sortable/archive/1.4.0.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "vcs",
            "url": "https://github.com/UH-StudentServices/video_embed_unitube"
        },
        {
            "type": "vcs",
            "url": "https://github.com/UH-StudentServices/uh_courses_embed"
        },
        {
            "type": "vcs",
            "url": "git@github.com:UH-StudentServices/student_guide.git"
        }
    ],

Notice that although the profile will install, you will see:

 Cannot apply patch 2795115-6-and-2860399-1 (patches/google_analytics_reports.patch)!

That is because there is a patches directory in the parent project that you will not have. I think that if you copy the patches to your own project, the patch may apply.

11
  • Now I am getting following error Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires uh-studentservices/student_guide ^1.62 -> satisfiable by uh-studentservices/student_guide[v1.62]. - uh-studentservices/student_guide v1.62 requires rubaxa/sortable 1.4.0 -> could not be found in any version, there may be a typo in the package name.
    – Umair
    Aug 4, 2021 at 17:10
  • This is what I did "repositories": [ { "type": "vcs", "url": "git@github.com:UH-StudentServices/student_guide.git" }, { "type": "vcs", "url": "https://github.com/larowlan/block_access" }, { "type": "composer", "url": "https://packages.drupal.org/8" } ],
    – Umair
    Aug 4, 2021 at 17:11
  • If you are specifying repositories, and still need to use the official one, Packagist, then you also require this one: { "type": "composer", "url": "asset-packagist.org" } It is there by default in the official Drupal starter project.
    – cilefen
    Aug 5, 2021 at 18:17
  • Thanks, but still the same error
    – Umair
    Aug 7, 2021 at 2:28
  • I suppose the only way forward is for you to post a composer.json that reproduces this.
    – cilefen
    Aug 9, 2021 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.