简体   繁体   English

为什么未安装Composer的软件包依赖关系?

[英]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 -vvvlocal/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.

相关问题 Composer没有安装Package的依赖项 - Composer not installing dependencies of Package 如果全局安装 npm 包,如何在本地包中插入依赖项 - How to insert dependencies in local package if npm package is installed globally 与作曲家安装laravel依赖项不起作用 - installing laravel dependencies with composer not working Composer创建本地包 - Composer create local package Composer 在更新依赖项时挂起 - Composer hanging while updating dependencies 为什么 package-lock.json 与 package.json 有不同的列出的依赖关系? - Why does package-lock.json have different listed dependencies to package.json? 作曲家更新未自动加载名称空间 - namespaces not being autoloaded by composer update 为什么package.json和npm info之间的依赖库版本不同 - Why dependencies library version is different between package.json and npm info 如何使用内置的composer-plugin创建单片Composer包? - How to create a monolithic Composer package with a built-in composer-plugin? Github说我在package-lock(cryptiles)中有一个Node安全漏洞,但是它没有安装在package.json中而且我没有使用它,解决方案呢? - Github says I have a Node security vulnerability in package-lock (cryptiles) but it's not installed in package.json and I'm not using it, solutions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM