[英]Why Composer's package dependencies are not being installed?
I've got the following composer.json
file: 我有以下
composer.json
文件:
{
"require": {
"local/my_package": "dev-master"
},
"repositories": [
{
"packagist.org": false
},
{
"type": "path",
"url": "my_package/"
}
]
}
which requires my local package which defines the following my_package/composer.json
file: 这需要我的本地软件包,该软件包定义了以下
my_package/composer.json
文件:
{
"name": "local/my_package",
"require-dev": {
"symfony/console": "*"
}
}
Note: The my_package
folder is under Git repository with the default master
branch. 注意:
my_package
文件夹位于Git存储库下,具有默认的master
分支。
Note: To create new repo, run: git init && git add -A && git commit -am'Files'
. 注意:要创建新的
git init && git add -A && git commit -am'Files'
,运行: git init && git add -A && git commit -am'Files'
。
When I run: composer install -vvv
, the local/my_package
package is installed correctly, but nothing else. 当我运行时:
composer install -vvv
, local/my_package
软件包已正确安装,但没有其他安装。 I would expect that dependencies defined in symfony/console
should be installed as well. 我希望也应该安装
symfony/console
定义的依赖项。
Executing command (my_package/): git log -n1 --pretty=%H
- Installing local/my_package (dev-master)
How should I correct my composer.json
file, so the package's dependencies can be installed automatically? 我应该如何纠正
composer.json
文件,以便可以自动安装软件包的依赖项?
It seems the require-dev
keyword in the package's composer.json
file should be changed to require
. 似乎应该将包的
composer.json
文件中的require-dev
关键字更改为require
。
The require-dev
property is only required for developing the package ( root package ). 仅在开发程序包( root程序包 )时才需要
require-dev
属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.