安装Yii2 Advanced模板不起作用 [英] Installation Yii2 Advanced template not working

查看:115
本文介绍了安装Yii2 Advanced模板不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试部署Yii2高级模板时,总是会遇到无法正常工作的应用程序。

When I try to deploy the Yii2 advanced template, I always end up with a not working application.

错误消息是:


无效参数– yii\base\InvalidParamException
要发布的文件或目录不存在:
[...] / yii-application / 供应商/ bower / jquery / dist

我尝试通过最新的作曲家版本进行安装,无论是否带有fxp资产插件。对于这两个错误消息是相同的。

I tried to install via the recent composer version, with and without the the fxp asset plugin. The error message is same for both.

我在Ubuntu64 16.04网络服务器上使用了官方文档进行安装。

I used the official documentaion for the installation on my Ubuntu64 16.04 webserver.

推荐答案

当您的作曲者配置创建 bower-asset 文件夹而不是 bower ,您可以修改 composer.json 并重新更新项目(1)或修改路径配置(2)。

When your composer configuration creates bower-asset folder instead of bower you can modify composer.json and reupdate project (1) or modify paths configuration (2).

(1)我不确定这里最好的解决方案是什么(也许其他人可以共享)-对于当前版本的composer和fx插件,路径配置存在一些问题。 extra 部分中的旧 asset-installer-paths 应该可以工作,但是会触发警告,建议不要使用配置。

(1) I'm not sure what is the best solution here (maybe someone else can share) - with current version of composer and fx plugin there is some problem with paths configuration. Old asset-installer-paths in extra section should work but it triggers warning for deprecated configuration.

(2)添加通用配置文件:

(2) Add in the common configuration file:

'aliases' => [
    '@bower' => '@vendor/bower-asset',
    '@npm'   => '@vendor/npm-asset',
],

这将更改资产的路径一切都应该正常工作。

This will change paths to assets and all should work fine.

这篇关于安装Yii2 Advanced模板不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆