K
K
Ken Jee2016-02-10 21:54:06
Yii
Ken Jee, 2016-02-10 21:54:06

How to add bower/jquery/dist directory to Yii2?

I am creating a Yii2 project from scratch. When trying to access /index.php?r=gii, an error is generated:

Invalid Parameter - yii\base\InvalidParamException
The file or directory to be published does not exist: E:\OpenServer\domains\testsite/vendor\bower/jquery/dist

Here is my composer.json:
{
  "require": {
    "yiisoft/yii2": ">=2.0.6",
    "yiisoft/yii2-twig": "^2.0",
    "yiisoft/yii2-bootstrap": "~2.0.0"
  },
  "require-dev": {
    "yiisoft/yii2-gii": "^2.0"
  },
  "config": {
    "process-timeout": 1800
  },
  "extra": {
    "asset-installer-paths": {
      "npm-asset-library": "vendor/npm",
      "bower-asset-library": "vendor/bower"
    }
  }
}

The plugin is also globally installed:
composer global require "fxp/composer-asset-plugin:~1.1"

Tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex Khizhniy, 2016-11-04
@Machez

Specify the root folder for storing bower packages, you can use the file (.bowerrc) in the root of the project:

{
  "directory": "vendor/bower"
}

I
Ivan Anikin, 2017-04-21
@randomize

Caught this error when executed
Before installing the plugin
Well, the composer did not pull everything up.
You need to install a plugin
and then run
сomposer install

P
pantsarny, 2016-02-10
@pantsarny

Composer install

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question