Symfony 4 - 安装捆绑包时出现问题
Symfony 4 - Problems installing Bundles
我尝试安装条形码包,但出现错误,也许有人可以帮助我:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for __root__ dev-master -> satisfiable by __root__[dev-master].
- alpin11/twig-barcode v1.0 requires symfony/symfony ^3.4 || ^4.0 -> satisfiable by symfony/symfony[v4.3.0, v4.3.1, v4.3.10, v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9].
- symfony/symfony v4.3.10 conflicts with __root__[dev-master].
- symfony/symfony v4.3.11 conflicts with __root__[dev-master].
- symfony/symfony v4.3.3 conflicts with __root__[dev-master].
- symfony/symfony v4.3.4 conflicts with __root__[dev-master].
- symfony/symfony v4.3.5 conflicts with __root__[dev-master].
- symfony/symfony v4.3.6 conflicts with __root__[dev-master].
- symfony/symfony v4.3.7 conflicts with __root__[dev-master].
- symfony/symfony v4.3.8 conflicts with __root__[dev-master].
- symfony/symfony v4.3.9 conflicts with __root__[dev-master].
- symfony/symfony v4.3.0 conflicts with __root__[dev-master].
- symfony/symfony v4.3.1 conflicts with __root__[dev-master].
- symfony/symfony v4.3.2 conflicts with __root__[dev-master].
- Installation request for alpin11/twig-barcode ^1.0 -> satisfiable by alpin11/twig-barcode[v1.0].
Installation failed, reverting ./composer.json to its original content.
这是我的 composer.json:
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"dompdf/dompdf": "^0.8.3",
"endroid/qr-code-bundle": "^3.3",
"phpoffice/phpspreadsheet": "^1.11",
"sensio/framework-extra-bundle": "^5.3",
"sensiolabs/security-checker": "^5.0",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/maker-bundle": "^1.11",
"symfony/orm-pack": "^1.0",
"symfony/security-bundle": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/web-server-bundle": "4.3.*",
"symfony/yaml": "4.3.*",
"twig/extensions": "^1.5"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
},
"require-dev": {
"symfony/profiler-pack": "^1.0",
"symfony/console": "^4.3"
}
}
你应该向那个包的提供者抱怨一个错误的决定:这个包强制安装 symfony/symfony
(所有 Symfony 组件的完整包),而所有当前项目应该依赖于个人组件。这就是您的项目所做的:它安装每个 需要的 组件,而不是整个框架。
这就是您遇到困难的地方:完整的框架包 symfony/symfony
包含所有组件并在 replaces
部分列出它们。同时安装框架包 和 单个组件会导致问题,而且是不可能的。但是由于那个条码包依赖于整个框架,而你自己的应用依赖于单个组件,所以无法继续安装。
如果你真的想使用这个包(可能有更好地构建它们的依赖关系的替代方案),你可以从你的 composer.json
而是需要 symfony/symfony:4.3.*
。之后,该软件包应该可以安装
我尝试安装条形码包,但出现错误,也许有人可以帮助我:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.3.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for __root__ dev-master -> satisfiable by __root__[dev-master].
- alpin11/twig-barcode v1.0 requires symfony/symfony ^3.4 || ^4.0 -> satisfiable by symfony/symfony[v4.3.0, v4.3.1, v4.3.10, v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9].
- symfony/symfony v4.3.10 conflicts with __root__[dev-master].
- symfony/symfony v4.3.11 conflicts with __root__[dev-master].
- symfony/symfony v4.3.3 conflicts with __root__[dev-master].
- symfony/symfony v4.3.4 conflicts with __root__[dev-master].
- symfony/symfony v4.3.5 conflicts with __root__[dev-master].
- symfony/symfony v4.3.6 conflicts with __root__[dev-master].
- symfony/symfony v4.3.7 conflicts with __root__[dev-master].
- symfony/symfony v4.3.8 conflicts with __root__[dev-master].
- symfony/symfony v4.3.9 conflicts with __root__[dev-master].
- symfony/symfony v4.3.0 conflicts with __root__[dev-master].
- symfony/symfony v4.3.1 conflicts with __root__[dev-master].
- symfony/symfony v4.3.2 conflicts with __root__[dev-master].
- Installation request for alpin11/twig-barcode ^1.0 -> satisfiable by alpin11/twig-barcode[v1.0].
Installation failed, reverting ./composer.json to its original content.
这是我的 composer.json:
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"dompdf/dompdf": "^0.8.3",
"endroid/qr-code-bundle": "^3.3",
"phpoffice/phpspreadsheet": "^1.11",
"sensio/framework-extra-bundle": "^5.3",
"sensiolabs/security-checker": "^5.0",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/maker-bundle": "^1.11",
"symfony/orm-pack": "^1.0",
"symfony/security-bundle": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/web-server-bundle": "4.3.*",
"symfony/yaml": "4.3.*",
"twig/extensions": "^1.5"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\Tests\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
},
"require-dev": {
"symfony/profiler-pack": "^1.0",
"symfony/console": "^4.3"
}
}
你应该向那个包的提供者抱怨一个错误的决定:这个包强制安装 symfony/symfony
(所有 Symfony 组件的完整包),而所有当前项目应该依赖于个人组件。这就是您的项目所做的:它安装每个 需要的 组件,而不是整个框架。
这就是您遇到困难的地方:完整的框架包 symfony/symfony
包含所有组件并在 replaces
部分列出它们。同时安装框架包 和 单个组件会导致问题,而且是不可能的。但是由于那个条码包依赖于整个框架,而你自己的应用依赖于单个组件,所以无法继续安装。
如果你真的想使用这个包(可能有更好地构建它们的依赖关系的替代方案),你可以从你的 composer.json
而是需要 symfony/symfony:4.3.*
。之后,该软件包应该可以安装