场景
当使用composer requeir mdmsoft/yii2-admin ~2.0或composer requeir "dmstr/yii2-adminlte-asset" "2.*"等依赖https://github.com/DmitryBaranovskiy/eve.git资源的应用组件时时返回 [Composer\Repository\InvalidRepositoryException] No valid bower.json was found in any branch or tag of https://github.com/DmitryBaranovskiy/eve.git, could not load a package from it.的错误.
原因
因为https://github.com/DmitryBaranovskiy/eve返回404页面未找到...所以,在Bower Regsitry注册的前依赖包无效。
解决方案
A方案
更新composer.json文件:
"config": {
"fxp-asset": {
"repositories": {
"bower-asset/eve": {
"type": "bower-vcs",
"url": "https://github.com/adobe-webplatform/eve.git"
}
}
}
},
B方案
以上composer包针对这个错误在新版本进行了修复:
"dmstr/yii2-adminlte-asset" : ">2""mdmsoft/yii2-admin" : "dev-master#1c0887eff2fe5eac924c413219d20e761d5e1d9a"
参考链接
- [https://github.com/dmstr/yii2-adminlte-asset/issues/123]
- [https://github.com/mdmsoft/yii2-admin/issues/353]
- [https://github.com/dmstr/yii2-adminlte-asset/issues/133#issuecomment-337179853]