Skip to main content
 首页 » 编程设计

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

2024年04月12日23luoye11

我通过 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 
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. 

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

感谢您的帮助:)

请您参考如下方法:

终于修复了它,只需按照 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" 
    } 
} 

希望这有帮助:)