无法在Yii2项目上运行'composer update':yiisoft / yii2 2.0.7需要bower

编程入门 行业动态 更新时间:2024-10-23 11:26:08
无法在Yii2项目上运行'composer update':yiisoft / yii2 2.0.7需要bower-asset / jquery 2.2.*@stable(Cannot run 'composer update' on Yii2 project: yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable)

我删除了我的vendor/目录并运行了composer update ,但它给了我一个错误。

$ composer update 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 typo in the package name. Problem 2 - yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.4 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.3 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7]. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

我甚至尝试手动添加"bower-asset/jquery": "*",但它没有帮助。

composer.json { "name": "yiisoft/yii2-app-basic", "description": "Yii 2 Basic Application Template", "keywords": ["yii2", "framework", "basic", "application template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": "~5.4", "ext-gd": "*", "ext-soap": "*", "ext-mcrypt": "*", "ext-mbstring": "*", "yiisoft/yii2": "*", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*", "yiisoft/yii2-redis": "~2.0", "yiisoft/yii2-debug": "*", "bower-asset/jquery": "*", "exeu/apai-io": "*", "mervick/yii2-mthaml": "*", "googleads/googleads-php-lib": "~6.5" }, "require-dev": { "heroku/heroku-buildpack-php": "*", "yiisoft/yii2-codeception": "*", "yiisoft/yii2-gii": "*", "yiisoft/yii2-faker": "*" }, "config": { "process-timeout": 1800 }, "scripts": { "post-create-project-cmd": [ "yii\\composer\\Installer::postCreateProject" ], "compile": "php yii asset assets.php config/assets-prod.php" }, "extra": { "yii\\composer\\Installer::postCreateProject": { "setPermission": [ { "runtime": "0777", "web/assets": "0777", "yii": "0755" } ], "generateCookieValidationKey": [ "config/web.php" ] }, "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } }, "autoload": { "classmap": [ "vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util" ] } }

那个包似乎存在。

$ composer search bower | grep jquery bower-asset/jquery

I deleted my vendor/ directory and ran composer update, but it's giving me an error.

$ composer update 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 typo in the package name. Problem 2 - yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.4 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.3 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.2 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.1 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - yiisoft/yii2 2.0.0 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found. - Installation request for yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7]. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I even tried to manually add "bower-asset/jquery": "*", but it didn't help.

composer.json { "name": "yiisoft/yii2-app-basic", "description": "Yii 2 Basic Application Template", "keywords": ["yii2", "framework", "basic", "application template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": "~5.4", "ext-gd": "*", "ext-soap": "*", "ext-mcrypt": "*", "ext-mbstring": "*", "yiisoft/yii2": "*", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*", "yiisoft/yii2-redis": "~2.0", "yiisoft/yii2-debug": "*", "bower-asset/jquery": "*", "exeu/apai-io": "*", "mervick/yii2-mthaml": "*", "googleads/googleads-php-lib": "~6.5" }, "require-dev": { "heroku/heroku-buildpack-php": "*", "yiisoft/yii2-codeception": "*", "yiisoft/yii2-gii": "*", "yiisoft/yii2-faker": "*" }, "config": { "process-timeout": 1800 }, "scripts": { "post-create-project-cmd": [ "yii\\composer\\Installer::postCreateProject" ], "compile": "php yii asset assets.php config/assets-prod.php" }, "extra": { "yii\\composer\\Installer::postCreateProject": { "setPermission": [ { "runtime": "0777", "web/assets": "0777", "yii": "0755" } ], "generateCookieValidationKey": [ "config/web.php" ] }, "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } }, "autoload": { "classmap": [ "vendor/googleads/googleads-php-lib/src/Google/Api/Ads/Common/Util" ] } }

That package seems to exist.

$ composer search bower | grep jquery bower-asset/jquery

最满意答案

你应该先跑

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

此命令安装composer资产插件,该插件允许通过Composer管理bower和npm软件包依赖项。

正如Yii的贡献者所说

我们将在2.1中解决这个问题。

You should run first

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

This command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer.

As said one of contributors of Yii

We're going to fix that in 2.1.

更多推荐

本文发布于:2023-08-06 10:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1446680.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   update   composer   bower   yiisoft

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!