在https://github.com/yiisoft/jquery-pjax.git的任何分支或标记中均未找到有效的bower.json

时间:2018-11-23 01:54:46

标签: yii2 composer-php bower

您好,在全球范围内将软件包安装到composer之后,我对composer的安装有一些疑问。看到下面的错误

[Composer\Repository\InvalidRepositoryException]
  No valid bower.json was found in any branch or tag of https://github.com/yiisoft/jquery-pjax.git, could not load a package from it

1 个答案:

答案 0 :(得分:0)

您需要尝试这些解决方案,并且通常可以将其修复:

1)如果您拥有防病毒功能,请关闭它,因为它可能会阻止某些所需的端口。

2)在您的项目中运行此命令composer clear-cache

3)如果第一个和第二个解决方案均无效,则转到/root/.composer目录,并创建文件config.json并将这些命令放入其中。

{
    "config": {
        "preferred-install": "dist",
        "github-protocols": ["https","http"],
        "github-oauth": {
            "github.com": "YourGithubOauth"
        }
    }
}

然后再次清除缓存。我希望它的工作。

祝你好运。