【发布时间】:2020-11-05 14:34:55
【问题描述】:
在 docker 下的 laravel 6 项目中,我切换到一个分支并为 其他开发者进行的更新 但是我通过运行 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 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-plugin-api。但我不确定这是一个正确的决定吗?
root@f32a029eae89:/app# composer 需要 composer-plugin-api 为 composer-plugin-api 使用版本 ^1.1 ./composer.json 已更新 使用包信息加载作曲家存储库 更新依赖项(包括 require-dev) PHP 致命错误:第 83 行 phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSet.php 中允许的内存大小为 1610612736 字节已用尽(尝试分配 134217736 字节)
致命错误:第 83 行 phar:///usr/bin/composer/src/Composer/DependencyResolver/RuleSet.php 中允许的内存大小为 1610612736 字节已用尽(尝试分配 134217736 字节)
查看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
- composer require package 命令的有效格式是什么?
我在 docker 控制台中检查作曲家:
root@f32a029eae89:/app# composer --version
Composer version 1.10.13 2020-09-09 11:46:34
【问题讨论】:
标签: php laravel composer-php