问题
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