密钥自动加载在第 20 行的 ./composer.json 中重复
Key autoload is a duplicate in ./composer.json at line 20
我在更新 composer 时遇到错误
这是composer.json
{
"name": "trigui/symfony",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload": {
"psr-4": {
"": "src/",
"VotreNamespace": "chemin/vers/la/bibliotheque"
},
"files": [ "app/AppKernel.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0",
"doctrine/doctrine-fixtures-bundle":"~2.3"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"branch-alias": null
}
}
这是错误:
Key autoload is a duplicate in ./composer.json at line 20
A non-empty PSR-4 prefix must end with a namespace separator.
请问是什么问题?
您在第 5 行和第 20 行有 2 个自动加载键。在第 48 行和第 49 行有双括号关闭文件末尾
试试这个 json
{
"name": "trigui/symfony",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/",
"VotreNamespace": "chemin/vers/la/bibliotheque"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
],
"files": [ "app/AppKernel.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0",
"doctrine/doctrine-fixtures-bundle":"~2.3"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"branch-alias": null
}
谢谢大家,我已经像@Jorge Augusto Morêra de Moura 的回答一样更改了json
然后我删除了
"VotreNamespace": "chemin/vers/la/bibliotheque"
我在更新 composer 时遇到错误
这是composer.json
{
"name": "trigui/symfony",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload": {
"psr-4": {
"": "src/",
"VotreNamespace": "chemin/vers/la/bibliotheque"
},
"files": [ "app/AppKernel.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0",
"doctrine/doctrine-fixtures-bundle":"~2.3"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"branch-alias": null
}
}
这是错误:
Key autoload is a duplicate in ./composer.json at line 20
A non-empty PSR-4 prefix must end with a namespace separator.
请问是什么问题?
您在第 5 行和第 20 行有 2 个自动加载键。在第 48 行和第 49 行有双括号关闭文件末尾
试试这个 json
{
"name": "trigui/symfony",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/",
"VotreNamespace": "chemin/vers/la/bibliotheque"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
],
"files": [ "app/AppKernel.php" ]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0",
"doctrine/doctrine-fixtures-bundle":"~2.3"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"branch-alias": null
}
谢谢大家,我已经像@Jorge Augusto Morêra de Moura 的回答一样更改了json
然后我删除了
"VotreNamespace": "chemin/vers/la/bibliotheque"