場景
當使用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]