Reputation: 365
Seems like yii2 has some unresolved conflict between using the asset-packagist.org method, or the older fxp assets plugin. I am now working with a project, intended to use the asset-packagist. All settings appear OK, but Yii2 seems to ignore it all and insist on using a bower directory that does not exist. Using the asset-packagist method, this directory is called bower-asset.
The settings: To make this work, we use (in common/config/base.php):
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
...and in composer.json we set:
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
That does not help, however, still getting the error:
The file or directory to be published does not exist:
C:\....common\config/../../vendor/bower/semantic/dist
Also tried to switch fxp off with (in composer.json):
"config": {
"fxp-asset": {
"enabled": false
}
},
Also tried command:
composer global remove fxp/composer-asset-plugin --no-plugins
Same thing.
Note: The project was developed in Linux, I am now trying open it in Windows 10 and XAMPP on localhost. Feel free to tell me if Windows-related.
Upvotes: 2
Views: 2324
Reputation: 365
To get this to work, I had to choose the fxp-plugin, and to let go of the asset-packagist way (it simply does not work, given the knowledge I have at this point), like this:
asset-packagist.org
from repositories section in composer.json (in my case I removed the whole repositories section.:"repositories": [ { "type": "composer", "url": "https://asset-packagist.org" } ],
composer global require "fxp/composer-asset-plugin:~1.4.6"
fxp-asset
section to "config" in composer.json:"config": { "process-timeout": 1800, "fxp-asset":{ "installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } } }
composer install
. Upvotes: 2