我想从public Github
存储库(fork)修改一个扩展名,然后通过composer
安装到我的Magento2。
存储在这里的扩展名。真的,我只需要一个sample-external-links
。我尝试过很多次在我的洋红色2中配置composer.json,但是它不起作用,我会收到错误:
[Composer downloader transportException] 无法下载" https://api.github.com/repos/magento/magento/magento2-samples/sample-external-link"文件(找不到http/1.1 404)
如何将作曲家配置为从某个存储库中仅安装1个软件包?
我的Composer.json:
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/product-community-edition": "2.1.0",
"composer/composer": "@alpha",
"magento/sample-bundle-all": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.1.0",
"squizlabs/php_codesniffer": "1.5.3",
"phpmd/phpmd": "@stable",
"pdepend/pdepend": "2.2.2",
"fabpot/php-cs-fixer": "~1.2",
"lusitanian/oauth": "~0.3 <=0.7.0",
"sebastian/phpcpd": "2.0.0"
},
"config": {
"use-include-path": true
},
"autoload": {
"psr-4": {
"Magento\Framework\": "lib/internal/Magento/Framework/",
"Magento\Setup\": "setup/src/Magento/Setup/",
"Magento\": "app/code/Magento/"
},
"psr-0": {
"": "app/code/"
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
]
},
"autoload-dev": {
"psr-4": {
"Magento\Sniffs\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\Tools\": "dev/tools/Magento/Tools/",
"Magento\Tools\Sanity\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\TestFramework\Inspection\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\TestFramework\Utility\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
}
},
"minimum-stability": "alpha",
"prefer-stable": true,
"repositories": [
{ "type": "vcs",
"url": "https://github.com/magento/magento2-samples/sample-external-links"
}
],
"extra": {
"magento-force": "override"
}
您能尝试一下:
更改
"repositories": [
{ "type": "vcs",
"url": "https://github.com/magento/magento2-samples/sample-external-links"
}
],
to
"repositories": [
{
"type": "vcs",
"url": "git@github.com:samples/sample-external-links.git"
}
],
,然后添加您的模块:
"require": {
"magento/product-enterprise-edition": "2.2.5",
"composer/composer": "@alpha",
"yourvendor/sample-external-links": "dev-master", // your module should add here
},