我最近创建了一个Symfony捆绑包,源代码在这里:
https://gitlab.com/nicolasbonnici/restapibundle
当我尝试在Symfony 4.3项目中(从头开始创建或已存在的项目)通过composer来引用它时,我遇到了以下错误:
composer req nbo/rest-api-bundle
Using version ^1.1 for nbo/rest-api-bundle
./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
- don't install nbo/rest-api-bundle 1.1.0|remove __root__ dev-master
- don't install nbo/rest-api-bundle 1.1.1|remove __root__ dev-master
- don't install nbo/rest-api-bundle 1.1.2|remove __root__ dev-master
- Installation request for __root__ dev-master -> satisfiable by __root__[dev-master].
- Installation request for nbo/rest-api-bundle ^1.1 -> satisfiable by nbo/rest-api-bundle[1.1.0, 1.1.1, 1.1.2].
Installation failed, reverting ./composer.json to its original content.
这是项目的“composer.json”文件(但使用 SF 4.3 从头开始创建新项目的情况下仍然相同):
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"aws/aws-sdk-php": "^3.112",
"easycorp/easyadmin-bundle": "^2.3",
"friendsofsymfony/rest-bundle": "^2.5",
"intervention/image": "^2.5",
"lexik/jwt-authentication-bundle": "^2.6",
"nelmio/api-doc-bundle": "^3.4",
"nelmio/cors-bundle": "^1.5",
"sensio/framework-extra-bundle": "^5.4",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/cache": "4.3.*",
"symfony/console": "4.3.*",
"symfony/dotenv": "4.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.3.*",
"symfony/framework-bundle": "4.3.*",
"symfony/orm-pack": "^1.0",
"symfony/security-csrf": "4.3.*",
"symfony/serializer-pack": "^1.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/templating": "4.3.*",
"symfony/twig-bundle": "4.3.*",
"symfony/validator": "4.3.*",
"symfony/yaml": "4.3.*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.2",
"fzaninotto/faker": "^1.8",
"symfony/maker-bundle": "^1.12",
"symfony/phpunit-bridge": "^4.3",
"symfony/profiler-pack": "^1.0",
"symfony/web-server-bundle": "4.3.*"
},
"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"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.3.*"
}
}
}
有人可以帮我解决这个问题吗?
composer why-not nbo/rest-api-bundle
吗? - Taha Paksu