yii-basic 2.14 composer安装失败 解决办法
1.使用composer国区镜像
全局配置: composer config -g repo.packagist composer https://packagist.phpcomposer.com 项目单独配置: composer config repo.packagist composer https://packagist.phpcomposer.com
2.删除composer.json中默认的仓库配置
3.解决bower依赖
composer require yidas/yii2-bower-asset
然后我们看到依赖开始安装, composer安装失败的主要原因是默认的仓库访问很慢, 直接使用国区镜像, 需要解决bower依赖
4.修改bower配置: config/web.php
, 将别名指向@vendor/yidas/yii2-bower-asset/bower
$config = [ ... 'aliases' => [ '@bower' => '@vendor/yidas/yii2-bower-asset/bower' ], ... ];
如果没有配置密钥,需要在config/web.php
中加上一个密钥
'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'your-key', ], ... ]
安装成功了!
相关推荐
扮老虎的猪 2020-06-20
camillebower 2014-02-08
chenhua0 2014-07-17
SuschaBower 2014-07-05
octopusnju 2015-04-08
chenhua0 2015-05-28
扮老虎的猪 2015-10-18
chenhua0 2015-12-29
扮老虎的猪 2014-07-16
starleejay 2019-07-01
camillebower 2017-06-30
长井 2017-03-30
chenhua0 2016-12-16
camillebower 2016-05-12
ladewang 2016-01-20
chenhua0 2015-12-29
makenzibower 2015-11-12