Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii2 fresh install: vendor/bower/jquery/dist path is wrong

I just installed yii2 (advanced) using composer. I've setup nginx, etc.

But it doesn't work:

Invalid Parameter – yii\base\InvalidParamException

The file or directory to be published does not exist: /srv/www/site/vendor/bower/jquery/dist

In the folder 'vendor/bower' there is the only subfolder 'bower-assets' with 'jquery', etc in it. But no jquery in vendor/bower.

How to solve this issue?

like image 492
varan Avatar asked Dec 21 '15 19:12

varan


4 Answers

Please, refer the installation guide. It seems that you are missing asset plugin:

composer global require "fxp/composer-asset-plugin:~1.2.0"
like image 119
SilverFire Avatar answered Nov 07 '22 22:11

SilverFire


I was facing same issue,
this is how I fixed it-

  • go to vender .

    $ cd projectFile/vendor/
    
  • Rename bower-asset with bower

    $ mv bower-asset/ bower
    
  • Restart mamp/xamp

That fixed the issue and http://localhost:8888/ is working well.

like image 20
S.Yadav Avatar answered Nov 07 '22 23:11

S.Yadav


Make sure you have executed this command:

composer global require "fxp/composer-asset-plugin:~1.2.0"

Also, check your composer.json for these followings:

Deprecated, but default option from Yii2:

"extra": {
    "asset-installer-paths": {
        "npm-asset-library": "vendor/npm",
        "bower-asset-library": "vendor/bower"
    }
},

New option

"config": {
    "fxp-asset": {
        "installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        },
    }
},

Then run either composer update if you already have a composer.lock file, or composer install if you don't have composer.lock file yet.

like image 5
Syakur Rahman Avatar answered Nov 07 '22 23:11

Syakur Rahman


Check your composer.json file in the root of your project. You should have a section that look slike this;

    "asset-installer-paths": {
        "bower-asset-library": "vendor/bower-assets"
    }

This tells composer where to locate the bower files library. You may need to run composer update afterwards to get hte locations updated.

like image 1
Joe Miller Avatar answered Nov 08 '22 00:11

Joe Miller