Composer为私有Gitlab存储库失败



我有一个新项目,我想在那里需要一个私有的Gitlab存储库。这两个存储库都属于我,所以我可以随心所欲地更改。

项目的composer.json看起来像:

{"name":"thisismyproject","类型":"项目","最低稳定性":"dev","作者":[{"name":"我","电子邮件":"me@me.me"}],"存储库":[{"类型":"vcs","url":"https://gitlab.com/me/my-wordpress-plugin.git"}],"要求":{"composer/installers":"^1.0@dev","我/我的wordpress插件":"dev-master"},"额外":{"安装程序路径":{"wp-content/plugins/{$name}":["类型:wordpress插件"]}},"配置":{"gitlab令牌":{"gitlab.com":"thisismysupersecrettoken"}}}

wordpress插件库的composer.json看起来像:

{"name":"WordPress插件","description":"lorem","type":"wordpress插件","作者":[{"name":"我","电子邮件":"me@me.de"}],"require":{},"自动加载":{"psr-4":{"SomeNamespace\\":"。"}},"额外":{"分支别名":{"dev-master":"1.0-dev"}}}

composer update -vvv的输出看起来像:

下载https://gitlab.com/api/v4/projects/me%2Fmy-wordpress插件正在下载https://gitlab.com/api/v4/projects/me%2Fmy-wordpress插件/存储库/分支?per_page=100正在下载https://gitlab.com/api/v4/projects/me%2Fmy-wordpress-plugin/repository/files/comporter%2Esson/raw?参考=143c1818bfc96dcaa4ee5c2c0bd379c395491c正在下载https://gitlab.com/api/v4/projects/me%2Fmy-wordpress插件/存储库/标签?per_page=100正在读取WordPress插件的composer.json(v1.0.0)正在下载https://gitlab.com/api/v4/projects/me%2Fmy-wordpress-plugin/repository/files/comporter%2Esson/raw?参考=143c1818bfc96dcaa4ee5c2c0bd379c395491c写作/主页/流浪汉/缓存/作曲家/回购/gitlab.com/me/my-wordpress-plugin/143c118bfc96dcaa4ee5c2c0bd379c395491c进入缓存正在导入标记v1.0.0(1.0.0.0)正在读取WordPress插件的composer.json(master)正在导入分支主机(dev-master)正在下载https://packagist.org/packages.json无法将您的要求解析为一组可安装的程序包。问题1-在任何版本中都找不到请求的软件包me/my wordpress插件,可能在pa中有拼写错误包名称。潜在原因:-包裹名称拼写错误-根据您的最低稳定性设置,该软件包没有足够稳定的版本有关更多详细信息,请参阅。阅读以了解更多常见问题谢谢。

您收到错误是因为您的包名称不相同。

要修复它,您需要更新WordPress插件的composer.json中的名称。

{
"name": "me/my-wordpress-plugin",
"description": "WordPress Plugin",
"type": "wordpress-plugin",
"authors": [
{
"name": "me",
"email": "me@me.de"
}
],
"require": {},
"autoload": {
"psr-4": {
"SomeNamespace\": "."
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}

名称应与主composer.json:的require中的key相匹配

"require": {
"composer/installers": "^1.0@dev",
"me/my-wordpress-plugin": "dev-master"
},

相关内容

  • 没有找到相关文章

最新更新