当前位置: 首页 > 知识库问答 >
问题:

在docker下安装composer插件api时出错

彭浩穰
2023-03-14

在docker下的laravel 6项目中,我切换到一个分支,并对其他开发人员的更新进行git pull,但运行composer update时出错:

    - joshbrw/laravel-module-installer v1.0.1 requires composer-plugin-api ^2.0 -> no matching package found.
    - joshbrw/laravel-module-installer v1.0.1 requires composer-plugin-api ^2.0 -> no matching package found.
    - joshbrw/laravel-module-installer v1.0.0 requires composer-plugin-api ^2.0 -> no matching package found.
    - Installation request for joshbrw/laravel-module-installer ^1.0 -> satisfiable by joshbrw/laravel-module-installer[v1.0.0, v1.0.1].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability html" target="_blank">setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
...

在composer.lock中我找到了

"joshbrw/laravel-module-installer": "^1.0",

和:

"require": {
    "composer-plugin-api": "^2.0",
    "php": "^5.4|7.*"
},

在composer.json中,我看到:

"joshbrw/laravel-module-installer": "^1.0",

>

  • 我试图安装composer插件api。但我不确定这是一个正确的决定吗?

    root@f32a029eae89:/app#作曲家需要作曲家插件api使用版本^1.1为作曲家插件api。/composer.json已更新加载作曲家存储库与包信息更新依赖项(包括需要开发)PHP致命错误:允许内存大小为1610612736字节用尽(试图分配134217736字节)在phar://usr/bin/作曲家/src/作曲家/DependencyResolver/RuleSet.php行83

    致命错误:允许的内存大小1610612736字节耗尽(试图分配134217736字节)在phar://usr/bin/作曲家/src/作曲家/DependencyResolver/RuleSet.php行83

    有关如何处理内存溢出错误的详细信息,请查看https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors。

    我检查内存:

    root@f32a029eae89:/app# php -r "echo ini_get('memory_limit').PHP_EOL;"
    1024M
    root@f32a029eae89:/app# free
                  total        used        free      shared  buff/cache   available
    Mem:        8085248     5249464     1238412      159684     1597372     2372452
    Swap:       2104476      905984     1198492
    

    我在docker控制台中检查composer:

    root@f32a029eae89:/app# composer --version
    Composer version 1.10.13 2020-09-09 11:46:34
    
  • 共有1个答案

    冀景明
    2023-03-14

    joshbrw/laravel模块安装程序v1.0.1需要composer插件api^2.0-

    您需要composer 2来安装该软件包,并且您正在使用composer 1。

    如果您使用的是Composer docker映像,您只需要添加:

    FROM composer:2 as composer
    

    到适当的dockerfile。如果您是手动下载,请确保您下载了相应的版本。

     类似资料:
    • 我已经安装了Composer,并遵循了Laravel 4文档中的快速入门指南。 我得到以下错误,当我运行或: 我尝试运行以下命令: 或者使用他们的: 或者从git获取zip版本:https://github.com/laravel/laravel?source=c 我仍然无法通过composer进行更新。 我在Mac上的PHP版本是: MAMP上的PHP版本:5.4.10 我在Google/Sta

    • 我正在尝试用composer安装maddhatter/laravelfullcalendar包(laravelhelper for fullcalendar.io)。下面是我运行的命令: ''php.././composer.phar需要maddhatter/laravel fullcalendar'' 结果是这样的: 将^1.3版用于maddhatter/laravel fullcalendar

    • 在macOS终端中运行时,出现以下错误。 PHP警告:preg_match():JIT编译失败:内存不足phar:///usr/local/bin/composer.phar/vendor/symfony/console/Application.php 在线755 在第755行PHP警告:preg_match():JIT编译失败:没有更多的内存在phar://usr/本地/bin/composer

    • http://eclipse-cs.sf.net/update/ 我在谷歌上搜索了很多,但没有找到一个合适的解决方案。请帮帮忙。提前致谢

    • 在按照此处所述签署eclipse插件之后 http://www.ibm.com/developerworks/opensource/library/os-eclipse-plugin-sigs/index.html 我得到这个错误,而安装插件。 收集要安装的项目时出错会话上下文为:(profile=SGXXProfile,phase=org.eclipse.equinox.internal.p2.

    • in Android Studio: go to File → Settings → Plugins → Browse repositories and search for 插件名 或者 in Android Studio: go to download it jar and install File → Settings → Plugins → Install plugin from disk