composer安装无法尝试将自己的typo3扩展托管在bitbucket上 [英] composer install fails trying to get own typo3 extension hosted on bitbucket
问题描述
我在Bitbucket上托管了TYPO3扩展。我想通过作曲家获得此扩展。据我了解,我的扩展根目录中必须有一个composer.json,而且我运行composer install的composer.json中必须包含一些条目
I have a TYPO3 extension hosted on bitbucket. I would like to get this extension with composer. As I understood, there must be a composer.json in my extension root and there must be some entries in my composer.json which i run composer install
composer.json我的扩展名
composer.json of my extension
{
"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,我运行作曲家更新:
composer.json which i run composer update:
{
"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"]
}
}
}
我总是得到一个错误:
在任何版本中都找不到请求的软件包路径/扩展名,软件包名称中可能有错字。
I get always an error: The requested package path/extension could not be found in any version, there may be a typo in the package name.
有人有可行的例子吗?
推荐答案
所请求的软件包
< insert-package-key-here>
在任何版本中均找不到,软件包名称中可能有错字。
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将使用该存储库中的标签和分支获取其版本信息。
This message means that the version that you're requesting Composer to install does not exist in the registered repository. Now, when requiring a package from a Git repository, Composer will use the tags and branches from that repository for its versioning information.
因为您需要将扩展名设置为 vendor / extKey: 2016
,Composer会在您的存储库中查找名为 2016
的标签。
As you have required your extension as "vendor/extKey": "2016"
, Composer will look for a tag named 2016
in your repository.
您在注释中表示,您有一个名为 2016
的分支。当需要分支时,您将需要在 composer.json
中使用 dev-< branch>
作为版本说明符:
You stated in comments that you have a branch named 2016
instead. When requiring a branch, you will need to use dev-<branch>
as version specifier in your composer.json
:
"require": {
"vendor/extKey": "dev-2016"
}
或者,在存储库中创建一个标记,并将其用作 composer.json
。
Alternatively, create a tag in your repository and use that as version in your composer.json
.
另请参见作曲家手册(重点为我):
See also the Composer manual on this (emphasis mine):
标签
对于每个看起来像版本的标签,都会创建该标签的打包版本。应与 XYZ或 vX.Y.Z匹配,并带有-patch(- p),-alpha(-a),-beta(-b)或-RC。后缀也可以跟数字。
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.
将为每个分支创建一个软件包开发版本。如果分支名称看起来像一个版本,则该版本将为 {branchname} -dev
。例如,分支2.0将获得2.0.x-dev版本(出于技术原因添加.x,以确保将其识别为分支)。 2.0.x分支也将有效,并且也将转换为2.0.x-dev。 如果分支看起来不像一个版本,它将是 dev- {branchname}
。 master
生成 dev-master
版本。
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.
这篇关于composer安装无法尝试将自己的typo3扩展托管在bitbucket上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!