我正在用github为Laravel创建我的第一个库,在push步骤之后,我尝试通过composer获得这个库:
composer require malekbenelouafi/laravel-status
但是,我总是会犯这样的错误:
InvalidArgumentException 无法在任何版本中找到包malekbenelouafi/laravel状态,以保证您的最低稳定性(dev)。检查包的拼写或最低稳定性。
这是我在github的图书馆的链接:
https://github.com/malekbenelouafi/laravel-status
谢谢。
发布于 2018-03-08 15:08:41
你的项目不是一个作曲家包,它只是在吉特布上。Composer与Github是分开的,您必须在Packagist这样的聚合器上发布您的包。
转到帕卡吉斯特网站,查看有关“发布包”的说明。
或者,如果您还没有准备好或不想将库作为一个包发布,您应该能够修改您的composer.json来处理这个问题,而不需要发布。
基本上,您只需要将Github添加到composer.json中,如下所示:
{
"repositories": [
{
"url": "https://github.com/malekbenelouafi/laravel-status.git",
"type": "git"
}
],
"require": {
// Other required libraries
}
}发布于 2018-03-08 15:10:38
@‘’Aller是正确的,你没有包裹。但是,您应该能够修改您的composer.json来处理这个问题,而无需将您的回购包发布到包中。您可以在这里读到更多关于这一点的信息:https://stackoverflow.com/a/14485706/1561929。
https://stackoverflow.com/questions/49176218
复制相似问题