为什么我不能成功使用composer require {packageName}? [英] Why I can't use composer require {packageName} successfully?
问题描述
我正在学习如何创建Laravel软件包,并在此处编写了一个软件包: noahprot/fillindata
I'm learn how to create Laravel packages, And I wrote a package here: noahprot/fillindata
然后我将其提交给包装专家
Packagist显示如下: 已显示最新版本
And the Packagist show like this: Already show the latest release
然后我使用Laravel CLI工具创建一个新的laravel项目,我想尝试使用此软件包,然后使用composer require noahprot/fillindata
Then I use Laravel CLI Tool create a new laravel project, I want try to use this package, and I use composer require noahprot/fillindata
但是这样的结果:
[InvalidArgumentException]
Could not find a version of package noahprot/fillindata matching your
minimum-stability (dev). Require it with an explicit version con
straint allowing its desired stability.
我的包裹的composer.json文件如下:
my package's composer.json file like this:
{
"name": "noahprot/fillindata",
"License": "MIT",
"description": "take the csv file fill into database table",
"authors": [
{
"name": "Noah Prot",
"email": "mylovewangjian@gmail.com"
}
],
"autoload": {
"psr-4": {
"NeoLee\\Fillindata\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"NoahProt\\Fillindata\\FillindataServiceProvider"
]
}
},
"require": {}
}
我尝试一下:
将"minimum-stability": "dev"
添加到composer.json,但失败,
甚至我编辑为稳定",但也失败了;
I make some try like:
add "minimum-stability": "dev"
to composer.json, but failed,
even I edit to "stable", but failed too;
我现在对这种情况一无所知;
I have no idea for this situation now;
伙计们,请帮助我,并提供一些建议!
Guys, Please Help me, and give some advice, please!
谢谢大家!
推荐答案
Packagist似乎存在一些与缓存相关的问题,请参见此问题.您正在使用的镜像可能包含一些过时的软件包信息.此时,您只能做两件事:
It seems that Packagist have some cache-related problems, see this issue. Mirror you're using probably have some outdated packages info. At this point you can do only two things:
- 等待,直到刷新镜像上的程序包数据.
- 举报您的案件(请参见此评论). li>
- Wait until packages data on mirror will be refreshed.
- Report your case (see this comment).
这篇关于为什么我不能成功使用composer require {packageName}?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!