Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot update yii2 via composer bower-asset/jquery could not be found

I was updating my yii2 via composer then reverted back to the old beta version.

Here is the error on 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.

Tried searching for bower-asset/jquery at packagist but it is not found.

Thanks for the help :)

like image 544
Jefren Inocando Avatar asked Sep 17 '14 04:09

Jefren Inocando


3 Answers

Finally fixed it, just followed the steps on the UPGRADE.md doc

If you are using Composer to upgrade Yii, you should run the following command first (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 latest version.)

You may also need to add the following code to your project's composer.json file :

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

Hopes this helps :)

like image 174
Jefren Inocando Avatar answered Sep 22 '22 13:09

Jefren Inocando


For me helps to remove folder ~/.composer and execute command:

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

Then just run again

php composer.phar update
like image 26
Ilya Kolesnikov Avatar answered Sep 20 '22 13:09

Ilya Kolesnikov


Found a cleaner solution. Just add following repository in your composer.json file

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

and watch the magic

like image 39
Shahzad Malik Avatar answered Sep 23 '22 13:09

Shahzad Malik