1

I have developed one extension and I have uploaded that in my GitHub private repository

https://github.com/bhaveshpp/Percentoffsale

now I have tried to install it using

composer require --dev bhaveshpp/Percentoffsale

but I got error

In InitCommand.php line 727: Could not find a matching version of package bhaveshpp/Percentoffsale. Check the package spelling, your version constraint and that the package is available in a stability w hich matches your minimum-stability (stable).

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-de pendencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

this is my composer.json file code

{
 "name": "bhaveshpp/Percentoffsale",
 "description": "A Magento 2 module that creates discount",
 "type": "magento2-module",
 "version": "0.1.0",
 "license": [
 "OSL-3.0",
 "AFL-3.0"
 ],
 "require": {
 "php": ">=7.0.0",
 "magento/framework": "~100.0.4"
 },
 "autoload": {
 "files": [ "registration.php" ],
 "psr-4": {
 "Zarathemes\\Percentoffsale\\": ""
 }
 }
 }

I have also try this solution

How to install an extension on a private Github using Composer?

{
 "name": "bhaveshpp/Percentoffsale",
 "description": "A Magento 2 module that creates discount",
 "type": "magento2-module",
 "version": "0.1.0",
 "license": [
 "OSL-3.0",
 "AFL-3.0"
 ],
 "require": {
 "php": ">=7.0.0",
 "magento/framework": "~100.0.4",
 "bhaveshpp/Percentoffsale": "dev-master"
 },
 "autoload": {
 "files": [ "registration.php" ],
 "psr-4": {
 "Zarathemes\\Percentoffsale\\": ""
 }
 },
 "repositories": [
 {
 "type": "vcs",
 "url": "[email protected]:bhaveshpp/Percentoffsale.git"
 }
 ]
 }

But i have got the same error.

If any one have a solution then provide

Any help would be appreciated.

Thanks in advance..!

asked Nov 12, 2019 at 9:50

2 Answers 2

2

Please set your repository Private to Public because the Private repository is not working for this operation.

Please set your package name in a lower case "bhaveshpp/Percentoffsale" to "bhaveshpp/percentoffsale".

Also, Check your GitHub repository into the "https://packagist.org/"

This solution will solve your issues.

Try with following composer.json file

{
 "name": "bhaveshpp/percentoffsale",
 "description": "A Magento 2 module that creates discount",
 "type": "magento2-module",
 "version": "0.1.0",
 "minimum-stability": "dev",
 "prefer-stable": "true",
 "license": "OSL-3.0", 
 "require": {
 "php": ">=5.4.0",
 "bhaveshpp/percentoffsale":"dev-master@dev"
 },
 "autoload": {
 "files": 
 [ 
 "registration.php" 
 ],
 "psr-4": {
 "Zarathemes\\Percentoffsale\\": ""
 }
 }
 }

In Github Repository, Release and Add a Tag.

answered Nov 12, 2019 at 10:55
2
  • it is usefull but my repository is private so it is not work for me thank you Commented Nov 14, 2019 at 3:35
  • First I have approved this extension by setting public repository and then it will install Commented Nov 14, 2019 at 10:31
0

Try to use this

"repositories": {
 "bhaveshpp-percentoffsale": {
 "type": "git",
 "url": "your_ssh_path_to_repo"
 }
}

Then execute "composer require bhaveshpp/percentoffsale"

answered Nov 12, 2019 at 10:34
2
  • thanku but it is not valid json format so it not work Commented Nov 12, 2019 at 11:17
  • updated my comment, try to convert package name to lower case and use only figure brackets Commented Nov 12, 2019 at 11:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.