I suddenly got this error few hours ago.
The file or directory to be published does not exist: `bower/jquery/dist`
Turns out the there is one more level under directory vendor/bower
,
$ ls vendor/bower
bower-asset
$ ls vendor/bower/bower-asset
ace-builds bootstrap handlebars jquery-slimscroll magnific-popup seiyria-bootstrap-slider zeroclipboard
angular bootstrap-hover-dropdown jquery jquery.sparkline.build moment slick-carousel
while in
https://github.com/yiisoft/yii2/blob/master/framework/base/Application.php#L456
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
I'm using "fxp/composer-asset-plugin:~1.0.3"
To reproduce
$ git clone [email protected]:yiisoft/yii2-app-basic.git
$ composer update --prefer-dist
$ ls vendor/
autoload.php bin/ bower/ cebe/ composer/ ezyang/ fzaninotto/ phpspec/ swiftmailer/ yiisoft/
$ ls vendor/bower/
bower-asset
$ ls vendor/bower/bower-asset
bootstrap jquery jquery.inputmask punycode typeahead.js yii2-pjax
$sed -n '456'p vendor/yiisoft/yii2/base/Application.php
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
The problem recently occurred and we are trying to figure out what happens.
Simple solution is by
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower/bower-asset');
but I don't know what cause this.
composer self-update 1.0.0-alpha11
composer clear-cache
Then repeat.
@samdark's solution is working
composer self-update 1.0.0-alpha11
composer clear-cache
thanks!
This is now fixed and fxp plugin is tagged.
go to the directory C:\wamp64\www\yii2-advanced-api\vendor and change bower-asset into bower. this helped me
I've same problem in 2017 (CARL !). The solution is
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
Just rename the folder "bower-asset" to "bower" in /vender directory. And make sure the directory "bower-asset" has all of its content
Still facing the issue with latest composer version 1.5.2 2017
make sure you have the latest version of the composer-asset-plugin and the config in composer.json:
I had the same issue when I updated to the latest composer.json
.
The solution: update the config/web.php
too. Add
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
to $config
. Like in the config/web.php
on master
now.
Hey there i am still facing this issue. i tried:
1). 'aliases' => [
'@bower' => '@vendor/bower',
'@npm' => '@vendor/npm-asset',
],
Need Help.
2020 - this issue still seems to exist and bother me;)
I had the same issue when I updated to the latest
composer.json
.
The solution: update theconfig/web.php
too. Add'aliases' => [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', ],
to
$config
. Like in theconfig/web.php
onmaster
now.
This worked for me.
Most helpful comment
I had the same issue when I updated to the latest
composer.json
.The solution: update the
config/web.php
too. Addto
$config
. Like in theconfig/web.php
onmaster
now.