2

Magento2 I have created a custom module & uploaded on package list so that anyone can download the module via composer. For downloading the module we are using the following command.

sudo composer require cuspay/exetension:dev-main

We are getting following error

[InvalidArgumentException]                 
  Could not find package cuspay/exetension.  
                                             
  Did you mean this?                         
      cuspay/exetension 

Can some one guide ma on what could be the issue? It would be a great help, thanks

4

1 Answer 1

1

Please check following points:

  • Do not use sudo with composer
  • Use composer 2 instead of composer 1 (This package is not installable via Composer 1.x)
  • Remove "require": { "bharat2533/cuspayextension": "dev-main"}" from your composer.json file as it does not exist.
  • After remove require, update package in https://packagist.org/

Hope Above will help!

15
  • Sadly stilll not working after making changes Commented Jul 19, 2021 at 11:17
  • can you confirm you are using composer 2 ? I am able to install your module! you check number of install on your packagist. it is showing 1 Commented Jul 19, 2021 at 14:02
  • I m getting error while installing in version 2. Your requirements could not be resolved to an installable set of packages. Problem 1 - magento/composer-root-update-plugin is locked to version 1.0.0 and an update of this package was not requested. - magento/composer-root-update-plugin 1.0.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint. Problem 2 - dealerdirect/phpcodesniffer-composer-installer is locked to version v0.5.0 and an update of this package was not requested. Commented Jul 19, 2021 at 14:11
  • Can u let me know cmd u used? Commented Jul 19, 2021 at 14:17
  • I installed it in separate directory not in magento. it seems magento 2 still need composer 1 while your module need composer 2. keep global composer to magento 1 and use composer 2 using composer.phar file!. Commented Jul 19, 2021 at 14:19

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.