【发布时间】:2022-03-05 02:50:21
【问题描述】:
当我运行这个命令时
composer config repositories.companyname composer https://composer.companyname.com/community/
我收到此错误
[Seld\JsonLint\ParsingException]
"" does not contain valid JSON
Parse error on line 1:
composer https://
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
我的 JSON 文件内容
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"version": "2.4.1",
"require": {
"magento/product-community-edition": "2.4.1",
"magento/composer-root-update-plugin": "~1.0"
},
"autoload": {
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
],
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"psr-4": {
"Magento\\": "app/code/Magento/",
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
}
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"friendsofphp/php-cs-fixer": "~2.16.0",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": ">=0.12.3 <=0.12.23",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "~5.0.0",
"squizlabs/php_codesniffer": "~3.5.4"
},
"conflict": {
"gene/bluefoot": "*"
},
"autoload-dev": {
"psr-4": {
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/",
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/"
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-force": "override"
}
}
我尝试使用 root 用户和所有者用户运行 composer。我正在尝试通过 composer 安装一个模块
我在 https://jsonlint.com/ 上测试了我的 composer.json 文件,但结果是“有效 JSON”。
我尝试用谷歌搜索错误,但找不到任何解决方案
有人可以帮忙吗?
【问题讨论】:
-
请分享更多细节 - 你在调用哪个命令,
composer.json包含什么? -
@NicoHaase 你是对的。我添加了更多细节感谢您的建议!
标签: composer-php magento2