Installation Yii2 Advanced template not working

笑着哭i 提交于 2019-12-08 10:40:28

问题


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

The error message is:

Invalid Parameter – yii\base\InvalidParamException The file or directory to be published does not exist: [...]/yii-application/vendor/bower/jquery/dist

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

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


回答1:


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) 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) 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.



来源:https://stackoverflow.com/questions/44669167/installation-yii2-advanced-template-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!