Unable to update yii2 through composer bower-asset / jquery could not be found

I updated my yii2 through the composer and then reverted to the old beta.

Here is the error of my composer:

Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package bower-asset/jquery could not be found in any version, there may be a typ o in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setti ng see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. 

I tried searching for bower-asset / jquery in packagist, but it was not found.

Thanks for the help:)

+46
yii2 composer-php
Sep 17 '14 at 4:22
source share
4 answers

Finally, fixed it by simply following the steps in the UPGRADE.md document

If you use Composer to update Yii, you must first run the following command (once for all) to install the composer-asset plugin:

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

(see http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-from-composer for the latest version.)

You may also need to add the following code to the composer.json project:

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

Hope this helps :)

+80
Sep 17 '14 at 6:45
source share

For me, it helps to delete the ~ / .composer folder and execute the command:

 php composer.phar global require "fxp/composer-asset-plugin:1.*" 

Then just run again

 php composer.phar update 
+15
Dec 05 '15 at 0:02
source share

If you do not need an update for bower assets, you can request yidas/yii2-composer-bower-skip to yiisoft/yii2. in composer.json file:

 "require": { "php": ">=5.4.0", "yidas/yii2-composer-bower-skip": "~2.0.0", "yiisoft/yii2": "~2.0.5", "yiisoft/yii2-bootstrap": "~2.0.0" } 

After that, you can smoothly update Composer without using bower assets.

See https://github.com/yidas/yii2-composer-bower-skip

+1
Jun 02 '17 at 1:36 on
source share

A cleaner solution has been found. Just add the following repository to composer.json file

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

and watch the magic

0
Nov 06 '17 at 8:50
source share



All Articles