0

I'm making a laravel composer package

The composer.json of the package looks like this

{
    "name": "mycomp/livesearch",
    "description": "Livewire livesearch package",
    "type": "library",
    "require": {
        "livewire/livewire": "dev-master"
    },
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "mycomp\\Livesearch\\": "src/"
        }
    },
    "authors": [
        {
            "name": "parallax",
            "email": "parallax4@gmail.com"
        }
    ],
    "minimum-stability": "dev",
    "prefer-stable": true
}

I've added it locally by adding this to my root composer.json

"repositories": [
    {
      "type": "path",
      "url": "packages/mycomp/*"
    }
  ]

But when I try to install the package using composer require mycomp/livesearch I get:

Could not find a version of package mycomp/livesearch matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

Constant
  • 574
  • 1
  • 5
  • 22
  • Does this answer your question? [Composer/Packagist could not find package for minimum stability](https://stackoverflow.com/questions/41149552/composer-packagist-could-not-find-package-for-minimum-stability) – Martin Zeitler Jul 07 '22 at 10:54
  • 1
    @MartinZeitler no it doesnt. thanks – Constant Jul 07 '22 at 10:57

1 Answers1

0

Fixed it.

Just had to add

"version": "1.0.0"

To my package's composer.json

Although, from what I've learnt this is a bad idea, and it's best to do version control with a VCS like Git. But for now, before I release the package and put it on github, this would suffice.

Constant
  • 574
  • 1
  • 5
  • 22