来自本地存储库InvalidArgumentException

时间:2018-10-12 09:46:59

标签: composer-php oxid

我正在尝试根据此示例Oxid 6模块创建一个模块
https://github.com/linslin/oxid6-example-module
我已经更改并将其克隆到
https://github.com/v3ritas1989/gg_oxid6-example-module
以及进入我的本地模块文件夹
..modules / compname / modulename

因此,一开始我要更改模块名称,子模块文件夹名称和给定的命名空间

modules/companyname/modulename
Path Example:
modules/linslin/oxid6-example-module

但是,如果我尝试安装模块 通过作曲家

composer require compname/gg_oxid6-example-module:dev-master
(for local folder)
composer require v3ritas1989/gg_oxid6-example-module:dev-master
(for git)

我收到错误消息:

  

[InvalidArgumentException]找不到匹配的版本   软件包compname / gg_oxid6-example-module。检查包装   拼写,您的版本限制以及该软件包在   与您的最小稳定性(稳定)相匹配的稳定性。

我不明白是为什么

composer require linslin/oxid6-example-module:dev-master

即使在工作,所以我删除了本地文件夹linslin
我想它是从github上拉出来的吗?

但是为什么这对我更改后的模块和github存储库不起作用?
我只做了搜索替换
模块名称
compname
namespacename

问题:
我假设作曲家只是找不到我的仓库或本地仓库。
所以

  1. 我如何要求作曲家只检查我的本地 文件夹?
  2. 为什么在我的github中也找不到它?

1 个答案:

答案 0 :(得分:1)

您需要按照以下说明在主composer.json文件中注册存储库: https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository 或在https://packagist.org/中注册您的包裹,以便将其自动检测出来。 还有其他注册存储库的方法,例如将其定义为本地存储库:https://getcomposer.org/doc/05-repositories.md#path

相关问题