Question

Can anyone please tell me the reason why module go to Vendor directory when install using composer?
Please refer me a link for this reason.

In my custom extension, I am using this code in my composer file.

{

"name": "vendor/module",
"description": "Magento 2 Shipping Rates",
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {},
"authors": [
{
  "name": "ABC",
  "email": "abc@mail.com",
  "homepage": "abc.com",
  "role": "Owner"
}
],
"autoload": {
"files": [ "registration.php" ],
"psr-4": {
  "Vendor\\Module\\": ""
}
},
"minimum-stability": "dev",
"prefer-stable": true 
}

Also, I have configured Github and Packagist too.
But when I try to install my module using composer by using command

composer require vendor/module

I am getting this error message.

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package vendor/module * is satisfiable by vendor/module[dev-master] but these conflict with your requirements or minimum-stability.


Installation failed, reverting ./composer.json to its original content.
Was it helpful?

Solution

In your github account have you pushed to master? Also what if you add a tag in git with label 1.0.0 and then push tag to master and for example and then try to do the following from within magento

composer require vendor/module:1.0.0

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top