首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我使用composer 2时,Heroku检测到composer 1

当我使用composer 2时,Heroku检测到composer 1
EN

Stack Overflow用户
提问于 2021-12-25 20:55:52
回答 1查看 2.8K关注 0票数 2

当试图在Heroku中部署时,它返回以下错误:

代码语言:javascript
复制
 !     The following is the full output from the installation attempt:
 !     
 !     > You are using Composer 1 which is deprecated. You should upgrade to Composer 2, see https://blog.packagist.com/deprecating-composer-1-support/
 !     > Loading repositories with available runtimes and extensions
 !     > Updating dependencies
 !     > Your requirements could not be resolved to an installable set of packages.
 !     > 
 !     >   Problem 1
 !     >     - The requested package composer-plugin-api could not be found in any version, there may be a typo in the package name.
 !     > 

关于如何解决这个问题,没有太多的信息。否则,我应该如何指定使用composer 2?所有东西都是从composer 2安装的。

composer.json

代码语言:javascript
复制
{
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "files": [
            "App/helpers.php"
        ]
    },
    "require": {
        "vlucas/phpdotenv": "^5.4",
        "abraham/twitteroauth": "^3.2",
        "jenssegers/blade": "^1.4",
        "bramus/router": "^1.6",
        "nesbot/carbon": "^2.55",
        "phpfastcache/phpfastcache": "*",
        "php": ">=8.0"
    }
}

作曲家-版本

代码语言:javascript
复制
Composer version 2.2.1 2021-12-22 22:21:31
EN

回答 1

Stack Overflow用户

发布于 2021-12-25 21:22:51

问题是确切的作曲家版本,heroku和composer版本2.1.14 (https://devcenter.heroku.com/articles/php-support#installation-of-dependencies)一起工作,我的作曲家是2.2.1。

我用以下方法修正了这个问题:

删除composer.lock &供应商

代码语言:javascript
复制
composer self-update 2.1.14
代码语言:javascript
复制
composer install
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70482678

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档