Skip to main content
 首页 » 编程设计

composer-php之无法通过 Composer Bower-asset/jquery 更新 yii2 找不到


我通过 Composer 更新了 yii2,然后恢复到旧的测试版。

这是我的 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 
   see <> for more details. 
Read <> for further common problems. 

尝试在 packagist 中搜索 Bower-asset/jquery 但未找到。



终于修复了它,只需按照 文档中的步骤操作即可

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

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

(请参阅 了解最新版本。)

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

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