nuvoleweb / simplemde

Drupal integration for SimpleMDE Markdown Editor https://www.drupal.org/project/simplemde
GNU General Public License v2.0
9 stars 5 forks source link

Fix "no matching package found" error #4

Open otarza opened 7 years ago

otarza commented 7 years ago

While trying to install this module using composer I'm getting following error:

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

  Problem 1
    - Installation request for drupal/simplemde 1.0-alpha3 -> satisfiable by drupal/simplemde[1.0.0-alpha3].
    - drupal/simplemde 1.0.0-alpha3 requires sparksuite/simplemde-markdown-editor 1.11.2 -> no matching package found.

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.

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

Steps to reproduce:

  1. Add "drupal/simplemde": "1.0-alpha3", to your composer.json;
  2. Run composer update;

I'm not sure what is causing this.

Workaround solution:

Add simplemde-markdown-editor in repositories of your composer.json file:

"repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
                "name": "sparksuite/simplemde-markdown-editor",
                "version": "1.11.2",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/sparksuite/simplemde-markdown-editor/archive/1.11.2.zip",
                    "type": "zip"
                }
            }
        }
    ],

Even workaround solution prevents the error, module itself still can't be enabled if you don't add "drupal/markdown": "1.2", as a dependency under your main composer.json, but this might be scope of another issue?

otarza commented 7 years ago

Similar issue: https://www.drupal.org/node/2770807

diqidoq commented 5 years ago

Add simplemde-markdown-editor in repositories of your composer.json file:

Since this is a Drupal integration module it should be stated clearly which composer.json file is referred to here. The composer.json file of the module or of Drupal core.

I also added a new issue on D.O. regarding this issue since there is no issue reflecting the fact that this module is not installable via composer at the moment by using the Drupal docs recommended way. https://www.drupal.org/project/simplemde/issues/3008627

GuyPaddock commented 5 years ago

IMO The docs for this project just need to add a note about adding the dependency under "repositories" in the Drupal site's composer.json file.

The reason is noted briefly here: https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md

You may run into problems when using custom repositories because Composer does not load the repositories of your requirements, so you have to redefine those repositories in all your composer.json files.