我尝试安装作曲家,但无法正常工作,并按照不同的步骤操作后出现以下问题。如果您知道如何解决,请帮忙
[Composer \ Repository \ InvalidRepositoryException]
在的任何分支或标记中均未找到有效的bower.json。 https://github.com/jquery/jquery-dist.git,无法加载程序包 从它。
composer global require "fxp/composer-asset-plugin:~1.4"
composer install
提供密钥,过一会说权限问题无法创建供应商文件夹,将权限授予该文件夹并运行
composer update
它给出了上述错误,然后我运行
composer clear-cache
composer install
提供密钥,但没有给出上述问题。
下面提到的是我的作曲家文件。
{
"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": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0",
"twilio/sdk": "^5.11",
"endroid/qrcode": "^2.3",
"2amigos/yii2-flysystem-component": "^1.0",
"cedricziel/flysystem-gcs": "^1.1",
"league/flysystem-cached-adapter": "^1.0",
"mpdf/mpdf":"*"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/base": "^2.2.3",
"codeception/verify": "~0.3.1",
"codeception/specify": "~0.4.3",
"kartik-v/yii2-widget-fileinput": "*",
"kartik-v/yii2-widget-datepicker": "*",
"kartik-v/yii2-grid": "*",
"kartik-v/yii2-widget-select2": "*",
"kartik-v/yii2-detail-view": "*",
"kartik-v/yii2-widgets": "*",
"kartik-v/yii2-money": "*",
"kartik-v/yii2-slider": "*",
"kartik-v/yii2-checkbox-x": "*",
"kartik-v/bootstrap-popover-x": "*",
"kartik-v/yii2-popover-x": "*",
"kartik-v/yii2-editable": "*",
"kartik-v/dependent-dropdown": "*",
"kartik-v/yii2-field-range": "*",
"kartik-v/bootstrap-checkbox-x": "*",
"kartik-v/bootstrap-fileinput": "*",
"kartik-v/yii2-widget-datetimepicker": "*",
"kartik-v/yii2-markdown": "*",
"2amigos/yii2-tinymce-widget": "*",
"2amigos/yii2-file-input-widget" : "*",
"razorpay/razorpay": "1.*",
"kop/yii2-conditional-validator": "dev-master",
"nodge/yii2-eauth": "~2.0",
"guzzlehttp/guzzle": "^6.1"
},
"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"
}
}
}
答案 0 :(得分:0)
我需要查看您的 composer.json ,但是据我所知,您已经尝试过
composer clear-cache
在您的项目中。
所以尝试这个:
转到 /root/.composer 目录,并创建文件 config.json 并将这些命令放入其中。
{
"config": {
"preferred-install": "dist",
"github-protocols": ["https","http"],
"github-oauth": {
"github.com": "YourGithubOauth"
}
}
}
然后再次清除缓存。我希望它的工作。
答案 1 :(得分:0)
将以下代码添加到您的composer.json文件
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
如果仍然不起作用。尝试删除fxp / composer-asset-plugin:
composer remove fxp/composer-asset-plugin
or
composer global remove fxp/composer-asset-plugin
答案 2 :(得分:0)
我通过将composer-asset-plugin更新到最新版本来解决了该问题:
composer global require "fxp/composer-asset-plugin:~1.4"
答案 3 :(得分:0)
我有类似的错误。一个简单的技巧是删除以前部分创建的供应商文件夹,然后再次运行composer install
。