无法通过composer php资源/ jquery更新yii2找不到

我通过composer php更新我的yii2,然后恢复到旧的beta版本。

这是我的composer php的错误:

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. 

试图在packagistsearchbower-asset / jquery,但没有find。

谢谢您的帮助 :)

最后修复它,只需按照UPGRADE.md文档中的步骤操作即可

如果您使用Composer来升级Yii,则应首先运行以下命令(一次性完成)以安装composer-asset-plugin:

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

(有关最新版本,请参见http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-from-composer 。)

您可能还需要将以下代码添加到项目的composer.json文件中:

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

希望这有助于:)

对我来说,有助于删除文件夹〜/ .composer并执行命令:

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

然后再运行一次

 php composer.phar update 

如果您不需要更新资源,您可以在yiisoft/yii2.之前使用yiisoft/yii2. yidas/yii2-composer-bower-skip yiisoft/yii2.composer.json文件中:

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

之后,您可以顺利地更新Composer,而无需使用资源。

请参阅https://github.com/yidas/yii2-composer-bower-skip

find一个更清洁的解决 只需在您的composer.json文件中添加以下资源库

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

并观看魔术