如何通过Composer安装GitHub包?解决命名格式报错问题
Composer安装GitHub包时的命名格式错误
以下配置可成功安装GitHub仓库中的包,执行composer install无异常:
{ "config": { "allow-plugins": { "composer/installers": true } }, "repositories": [ { "type": "git", "url": "https://github.com/tombenner/wp-mvc.git" } ], "require": { "tombenner/wp-mvc": "dev-master" } }
但使用如下composer.json配置安装另一GitHub包时:
{ "config": { "allow-plugins": { "composer/installers": true } }, "repositories": [ { "type": "git", "url": "https://github.com/sampoyigi/ti-ext-localepicker.git" } ], "require": { "sampoyigi/ti-ext-localepicker": "dev-master" } }
执行composer install会出现命名格式错误,错误信息翻译为中文如下:
在RootPackageLoader.php第160行:
require.ti-ext-localepicker 无效,它应当包含厂商名称、斜杠和包名。厂商名和包名可以是用-、.或_分隔的单词。完整名称需匹配正则表达式 "^a-z0-9/a-z0-9$"。
内容的提问来源于stack exchange,提问作者user294265
相关产品推荐
相关产品推荐

