Mat*_*cki 5 php git laravel composer-php
我做了我的叉子(https://github.com/digital-bird/LaravelShoppingcart某人的叉)(https://github.com/hardevine/LaravelShoppingcart)。
我想在我的 Laravel 项目中使用我的 fork +我想在将来修改它。
1)我从这个项目中删除了hardevine的叉子 composer remove hardevine/shoppingcart
2)然后我composer.json在我的叉子中修改了:
"name": "digital-bird/shoppingcart","hardevine/shoppingcart": "dev-master",??
"repositories": [
{
"type": "vcs",
"url": "https://github.com/digital-bird/LaravelShoppingcart"
}
],
Run Code Online (Sandbox Code Playgroud)
package.json我的新叉子看起来像:https : //github.com/digital-bird/LaravelShoppingcart/blob/master/composer.json
3)我把它推到我的叉子的主分支
4)我去了我的 Laravel 项目,然后输入:
composer require digital-bird/shoppingcart
Run Code Online (Sandbox Code Playgroud)
我收到大红色错误:
[InvalidArgumentException] 找不到包 digital-bird/shoppingcart 的匹配版本。检查包拼写、您的版本限制,以及该包是否以与您的最低稳定性(稳定)相匹配的稳定性提供。
我究竟做错了什么?
你应该添加这个:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/digital-bird/LaravelShoppingcart"
}
],
Run Code Online (Sandbox Code Playgroud)
到composer.json你的主要 Laravel 项目而不是你的图书馆。另外添加"hardevine/shoppingcart": "dev-master",似乎毫无意义,它可能会造成一些冲突。