composer install 尝试在 bitbucket 上托管自己的 typo3 扩展失败
composer install fails trying to get own typo3 extension hosted on bitbucket
我在 bitbucket 上托管了一个 TYPO3 扩展。我想通过 composer 获得这个扩展。据我了解,我的扩展根目录中必须有一个 composer.json 并且我的 composer.json 中必须有一些条目,我 运行 composer install
composer.json 我的分机
{
"name": "vendor/extkey",
"type": "typo3-cms-extension",
"description": "Extension for bla bla bla",
"keywords": [],
"homepage": "http://www.vendor.com",
"authors": [
{
"name": "blah",
"email": "dev@vendor.com",
"role": "Developer"
}
],
"version": "2016",
"require": {
"composer/installers": "~1.0",
"typo3/cms-core": "^7.6.0"
}
}
composer.json 我 运行 作曲家更新:
{
"repositories": [
{
"type": "composer",
"url": "http://composer.typo3.org/"
},
{
"type": "git",
"url": "https://user@bitbucket.org/path/extension.git"
}
],
"name": "blah",
"require": {
"typo3/cms": "7.6.2",
"bk2k/bootstrap-package" : "dev-master",
"path/extension": "2016"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
},
"installer-paths": {
"typo3conf/ext/{$name}": ["vendor/package"]
}
}
}
我总是得到一个错误:
无法在任何版本中找到请求的包 path/extension,包名称中可能有错字。
有人有工作示例吗?
The requested package <insert-package-key-here>
could not be found in any version, there may be a typo in the package name.
此消息表示您请求 Composer 安装的版本在已注册的存储库中不存在。现在,当需要来自 Git 存储库的包时,Composer 将使用该存储库中的标签和分支作为其版本控制信息。
由于您已将扩展名设为 "vendor/extKey": "2016"
,Composer 将在您的存储库中查找名为 2016
的标签。
您在评论中声明您有一个名为 2016
的 分支 。当需要分支时,您需要在 composer.json
:
中使用 dev-<branch>
作为版本说明符
"require": {
"vendor/extKey": "dev-2016"
}
或者,在您的存储库中创建一个标签并将其用作 composer.json
中的版本。
另请参阅 Composer manual(强调我的):
Tags
For every tag that looks like a version, a package version of that tag will be created. It should match 'X.Y.Z' or 'vX.Y.Z', with an optional suffix of -patch (-p), -alpha (-a), -beta (-b) or -RC. The suffix can also be followed by a number.
Branches
For every branch, a package development version will be created. If the branch name looks like a version, the version will be {branchname}-dev
. For example, the branch 2.0 will get the 2.0.x-dev version (the .x is added for technical reasons, to make sure it is recognized as a branch). The 2.0.x branch would also be valid and be turned into 2.0.x-dev as well. If the branch does not look like a version, it will be dev-{branchname}
. master
results in a dev-master
version.
我在 bitbucket 上托管了一个 TYPO3 扩展。我想通过 composer 获得这个扩展。据我了解,我的扩展根目录中必须有一个 composer.json 并且我的 composer.json 中必须有一些条目,我 运行 composer install
composer.json 我的分机
{
"name": "vendor/extkey",
"type": "typo3-cms-extension",
"description": "Extension for bla bla bla",
"keywords": [],
"homepage": "http://www.vendor.com",
"authors": [
{
"name": "blah",
"email": "dev@vendor.com",
"role": "Developer"
}
],
"version": "2016",
"require": {
"composer/installers": "~1.0",
"typo3/cms-core": "^7.6.0"
}
}
composer.json 我 运行 作曲家更新:
{
"repositories": [
{
"type": "composer",
"url": "http://composer.typo3.org/"
},
{
"type": "git",
"url": "https://user@bitbucket.org/path/extension.git"
}
],
"name": "blah",
"require": {
"typo3/cms": "7.6.2",
"bk2k/bootstrap-package" : "dev-master",
"path/extension": "2016"
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
},
"installer-paths": {
"typo3conf/ext/{$name}": ["vendor/package"]
}
}
}
我总是得到一个错误: 无法在任何版本中找到请求的包 path/extension,包名称中可能有错字。
有人有工作示例吗?
The requested package
<insert-package-key-here>
could not be found in any version, there may be a typo in the package name.
此消息表示您请求 Composer 安装的版本在已注册的存储库中不存在。现在,当需要来自 Git 存储库的包时,Composer 将使用该存储库中的标签和分支作为其版本控制信息。
由于您已将扩展名设为 "vendor/extKey": "2016"
,Composer 将在您的存储库中查找名为 2016
的标签。
您在评论中声明您有一个名为 2016
的 分支 。当需要分支时,您需要在 composer.json
:
dev-<branch>
作为版本说明符
"require": {
"vendor/extKey": "dev-2016"
}
或者,在您的存储库中创建一个标签并将其用作 composer.json
中的版本。
另请参阅 Composer manual(强调我的):
Tags
For every tag that looks like a version, a package version of that tag will be created. It should match 'X.Y.Z' or 'vX.Y.Z', with an optional suffix of -patch (-p), -alpha (-a), -beta (-b) or -RC. The suffix can also be followed by a number.
Branches
For every branch, a package development version will be created. If the branch name looks like a version, the version will be
{branchname}-dev
. For example, the branch 2.0 will get the 2.0.x-dev version (the .x is added for technical reasons, to make sure it is recognized as a branch). The 2.0.x branch would also be valid and be turned into 2.0.x-dev as well. If the branch does not look like a version, it will bedev-{branchname}
.master
results in adev-master
version.