Fresh-installed yii2 base app
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: /home/travkin/my_hosts/united_ua/vendor/bower/jquery/dist
/vendor/yiisoft/yii2/base/Application.php line 461
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
change to
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower-asset');
| Q | A
| ---------------- | ---
| Yii version | 2.0.12
@konorlevich i think you need upgrade your fxp/composer-asset-plugin
because installer-paths format is changed, and old version do not understands new format and installs to default bower-asset folder. Try run composer global require fxp/composer-asset-plugin
.
define aliases in your config if in composer.json you use asset-packagist.org
instead of fxp/composer-asset-plugin
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
This string Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
cann't be changed cause of bc break
I had the same problem with fxp/composer-asset-plugin 1.2
. The error disappeared after upgrading the plugin to version 1.3
.
In Yii 2.0.12
the config options for the asset-plugin have changed (see), because the old config format was deprecated, and changed in fxp/composer-asset-plugin v1.3.
The section for the asset-plugin has been removed from the install guide in the master branch, and this causes confusion for new installs. This has been discussed at the related commit.
@konorlevich Have you installed application template as it is listed in the manual?
Thanks for posting in our issue tracker.
In order to properly assist you, we need additional information:
Thanks!
_This is an automated comment, triggered by adding the label status:need more info
._
I had same problem, where i want overrides bower, npm, vendor alias.
I set alias on a bootstrap file, but seem yii/base/Application overrides it.
Maybe on setVendorPath method you can add validation is bower, npm, vendor not null.
So use value from Yii::setAlias on bootstrap file.
Thanks.
Or maybe we can use oomphinc/composer-installers-extender globaly for replace fxp/composer-asset-plugin.
And then add :
"extra": {
"installer-types": ["bower-asset", "npm-asset"],
"installer-paths": {
"vendor/bower/{$name}": ["type:bower-asset"],
"vendor/npm/{$name}" : ["type:npm-asset"]
}
},
I solve my problem by doing this.
i think you need upgrade your fxp/composer-asset-plugin because installer-paths format is changed, and old version do not understands new format and installs to default bower-asset folder. Try run composer global require fxp/composer-asset-plugin
@shirase, thank you, it works
Most helpful comment
define aliases in your config if in composer.json you use
asset-packagist.org
instead offxp/composer-asset-plugin