yii2: Composer dependency problem

I can’t execute composer update or composer install because Yii2 depends on “bower-asset/jquery”, which not longer exists (https://github.com/bower-asset/jquery)

Any solution? Thanks

Wokraround: https://github.com/yiisoft/yii2/issues/13247#issuecomment-267952064

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (15 by maintainers)

Most upvoted comments

For those who faced this problem - try https://asset-packagist.org as an alternative.

After adding asset-packagist to your composer.json, as it is described on the site do the following:

  1. Run composer install (or composer update)
  2. Considering that asset-packagist installs assets in a different directory, add the following lines to your application config (usually called as web.php)
$config = [
        'aliases' => [
            '@bower' => '@vendor/bower-asset',
            '@npm'   => '@vendor/npm-asset',
        ],
    ];

See https://asset-packagist.org/site/about to know more

Asset-packagist is not a temporary solution. It’s a full alternative to fxp/composer-asset-plugin, you are free to choose. We are going to add a guide article about it soon: https://github.com/yiisoft/yii2/issues/13064

asset-packagist does not respect "bower-asset-library": "vendor/bower" setting probably. Now @bower alias points to vendor/bower and asset-packagist puts bower packages in bower-asset folder.

I still have problem updating via composer

 - Installing bower-asset/jquery.inputmask (3.3.3)
    Downloading: Failed
    Failed to download bower-asset/jquery.inputmask from dist: The "https://api.github.com/repos/bower-asset/jquery.inputmask/zipball/a92cb06b4fe5788ebe7e45e56842c6141632b3ab" file could not be downloaded (HTTP/1.1 404 Not Found)

I cannot find a working solution to this problem though the issue is closed

@mrSerg161 paste the following content to config/web.php

$config = [
        ...
        'aliases' => [
            '@bower' => '@vendor/bower-asset',
            '@npm'   => '@vendor/npm-asset',
        ],
        ...
    ];

If your facing this problem:

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing bower-asset/jquery (1.12.4)
    Downloading: Failed
    Failed to download bower-asset/jquery from dist: The "https://api.github.com/repos/bower-asset/jquery/zipball/a76fe112f860279382d9f6336fe040fd8f8aa13d" file could not be downloaded (HTTP/1.1 404 Not Found)
    Now trying to download from source
  - Installing bower-asset/jquery (1.12.4)
    Cloning a76fe112f860279382d9f6336fe040fd8f8aa13d


  [RuntimeException]
  Failed to clone https://github.com/bower-asset/jquery.git via https, ssh, git protocols, aborting.
  - https://github.com/bower-asset/jquery.git
    Cloning into '/private/var/www/backend/app/vendor/bower-asset/jquery'...
    remote: Repository not found.
    fatal:***@github.com/bower-asset/jquery.git/' not found
  - git@github.com:bower-asset/jquery.git
    Cloning into '/private/var/www/backend/app/vendor/bower-asset/jquery'...
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
  - git://github.com/bower-asset/jquery.git
    Cloning into '/private/var/www/backend/app/vendor/bower-asset/jquery'...
    fatal: remote error:
      Repository not found.

to fix this situation you can add this to your composer.json

"repositories": [
       {
           "type": "composer",
           "url": "https://asset-packagist.org"
       }
   ],