1

I've made a plugin, that I'm now trying to include in a live project, but when I try to install it via the plugin installer, I get a 500 error, and if I try to include it using composer, I get the following error:

$ composer require mustasj/expanded-search
[InvalidArgumentException] Could not find a matching version of
package mustasj/expanded-search. Check the package spelling, your
version constraint and that the package is available in a stability
which matches your minimum-stability (stable).

I've set the version to 1.0.1 in GitHub: https://github.com/mustasj/expanded-search/releases

2

Looks like you haven't submitted your plugin repo to Packagist yet. You'll need to do that before it's available via Composer (per the docs).


Update and additional info: Like you mentioned in the comments, and like it's mentioned in the docs (see the Tip box here), Packagist is optional for your Craft plugin. You can totally add your plugin to the plugin store and install it via the plugin store without ever putting it on Packagist. If you use Craft's Update button in the dashboard, everything will work like you'd expect. The reason is because Craft is using its own logic (relying on Craftnet) to resolve packages. However, once you switch to running composer commands in the CLI to do your updating/installing/whatever, those packages won't be found (because they don't exist on Packagist yet) and Composer is obviously not using Craftnet's logic.

So if you want to be able to install/update your plugin via Composer, I'd recommend adding your plugin to Packagist. It honestly doesn't take that long (like 2 min maybe) and it will save you from quite a few support tickets down the road of people using Composer and having issues with your plugin's "absence".

2
  • Wow. For some reason I read that part of the docs as an optional. Thanks (:
    – peirix
    Mar 12 '19 at 19:43
  • 1
    Ben (from Pixel&Tonic) actually gave me some more info on this over in Discord after I answered the question, so I'll update my answer with some better info on "why". tldr; yes, it actually is optional... Mar 13 '19 at 0:42

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.