gpt4 book ai didi

yii2 - 更新 composer 抛出异常 Class Fxp\Composer\AssetPlugin\Repository\NpmRepository 不存在

转载 作者:行者123 更新时间:2023-12-03 22:47:50 24 4
gpt4 key购买 nike

我最近为 Yii2 基本应用程序模板运行了最新的 composer 安装。

但是正在运行 php composer.phar install抛出这个异常:

Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this WIL L break in the future and it should be fixed ASAP (require ^1.0 for example).

[ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

[ErrorException]

Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepository::w hatProvides() should be compatible with Composer\Repository\ComposerRepository:: whatProvides(Composer\DependencyResolver\Pool $pool, $name, $bypassFilters = fal se)



这是我的 composer.json:
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project 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.0",
"yiisoft/yii2": ">=2.0.5",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"

},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"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"
}
}
}

出了什么问题?有人经历过吗?

最佳答案

就像错误消息说的那样:
The "yiisoft/yii2-composer" plugin requires composer-plugin-api 1.0.0, this WILL break in the future and it should be fixed ASAP (require ^1.0 for example).
尝试更新您的 fxp/composer-asset-plugin :
php composer.phar global update fxp/composer-asset-plugin --no-plugins
PS:如果更新后仍然无法正常工作,请尝试以下操作:
composer global require fxp/composer-asset-plugin --no-plugins

关于yii2 - 更新 composer 抛出异常 Class Fxp\Composer\AssetPlugin\Repository\NpmRepository 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36579559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com