0

I am trying to require my package newly setup in packagist and github in a magento local projet when I run command.

composer require anasstouaticoder/magento2-module-instantconfigurationcopy

but I am getting this error message

[InvalidArgumentException]
Could not find a version of package anasstouaticoder/magento2-module-instantconfigurationcopy matching your minimum-stability (stable). Require it with an explicit ver
sion constraint allowing its desired stability.

require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--skip-magento-root-plugin] [--use-default-magento-values] [--interactive-magento-conflicts] [--base-magento-edition BASE-MAGENTO-EDITION] [--base-magento-version BASE-MAGENTO-VERSION] [--] []...

This is my composer.json

{
"name": "anasstouaticoder/magento2-module-instantconfigurationcopy",
"description": "The InstantConfigurationCopy module provides easy way to copy configuration field hints for admin in back office Magento 2.",
"keywords": [
    "magento 2",
    "back office",
    "config hint path",
    "hint path"
],
"authors": [
    {
        "name": "Anass TOUATI",
        "email": "anass1touati@gmail.com",
        "homepage": "https://www.linkedin.com/in/anass-touati-9a3b028b/",
        "role": "Leader"
    }
],
"require": {
    "magento/framework": "*",
    "magento/module-config": "101.2.*"
},
"type": "magento2-module",
"version": "1.0.1",
"license": [
    "MIT"
],
"autoload": {
    "files": [
        "registration.php"
    ],
    "psr-4": {
        "AnassTouatiCoder\\InstantConfigurationCopy\\": ""
    }
}

}

should I add "minimum-stability": "dev", ?

Thanks in advance

2
  • I faced same issue for hours, this is due to php version issue with composer, Try composer 1 with php 7.4 than It will work. Nov 7, 2022 at 18:17
  • I found out that the package is downloadable in when using Composer 2 + php 8.1, even if I do not specify that in my composer.json,I think packagist no longer allow newly created packages to be downloaded by composer 1 , thank you for your help
    – lazy_coder
    Dec 17, 2022 at 21:23

1 Answer 1

1

Please refer to Magento's official documentation for instruction on hosting your package.

You can find the instruction on link!

6
  • yes, I did all these steps in documentation but I still got this problem, for info when I add -vvv for more details => Downloading packagist.org/search.json?q=anasstouaticoder/…
    – lazy_coder
    Nov 6, 2022 at 15:50
  • after the message I got this back trace : Exception trace: () at phar:///usr/bin/composer/src/Composer/Command/InitCommand.php:782 Composer\Command\InitCommand->findBestVersionAndNameForPackage() at phar:///usr/bin/composer/src/Composer/Command/InitCommand.php:416 Composer\Command\InitCommand->determineRequirements() at phar:///usr/bin/composer/src/Composer/Command/RequireCommand.php:163 Composer\Command\RequireCommand->execute() at /var/www/html/vendor/magento/composer-root-update-plugin/Plugin/Commands/OverrideRequireCommand.php:188
    – lazy_coder
    Nov 6, 2022 at 15:53
  • 1
    Can you please refer to this video as it contains step by step instructions youtube.com/watch?v=4K19g6Nxnn4 Nov 6, 2022 at 16:07
  • If this answer works as your expected, please mark it as accepted. That indicates your issue is solved and makes it easier for others with the same issue to find a verified answer. And that would be great if you click the upvote button for the answer in case you feel it is useful. Nov 7, 2022 at 15:33
  • I found out that the package is downloadable in when using Composer 2, even if I do not specify compose version in my composer.json, think it is , thank you for your help
    – lazy_coder
    Dec 17, 2022 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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