Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a Magento2 sample-module using composer?

I am using Magento 2 EE on my local machine. I have been searching for a few hours on this one. I want to install the sample page module listed here:

https://github.com/magento/magento2-samples/tree/master/sample-module-newpage

Rather than upload and try to shoe-horn everything inside by creating and uploading files and folders I read this quote on the page:

This module is intended to be installed using composer.

I am new to Composer and the world of Grunt and Github forking and updating of files this way; I am old school but trying to adapt.

How do I do this? I have managed to install Composer on my machine and I have Terminal open to the folder of Magento 2. Can I just run a github command or Composer command; I tried:

#localhost:magento2ee: composer magento/sample-module-newpage

  [InvalidArgumentException]                               
  Command "magento/sample-module-newpage" is not defined.  

I also tried

#localhost:magento2ee: composer require magento/sample-module-newpage



  [InvalidArgumentException]
Could not find package magento/sample-module-newpage at any version for your minimum-stability (alpha). Check the package spelling or your minimum-stability  

The below is my composer.json file

{
    "name": "magento/magento2ee",
    "description": "Magento 2 (Enterprise Edition)",
    "type": "magento-core",
    "version": "1.0.0-beta4",
    "license": [
        "proprietary"
    ],
    "require": {
        "php": "~5.5.0|~5.6.0",
        "zendframework/zend-stdlib": "2.4.0",
        "zendframework/zend-code": "2.4.0",
        "zendframework/zend-server": "2.4.0",
        "zendframework/zend-soap": "2.4.0",
        "zendframework/zend-uri": "2.4.0",
        "zendframework/zend-validator": "2.4.0",
        "zendframework/zend-console": "2.4.0",
        "zendframework/zend-modulemanager": "2.4.0",
        "zendframework/zend-mvc": "2.4.0",
        "zendframework/zend-text": "2.4.0",
        "zendframework/zend-i18n": "2.4.0",
        "zendframework/zend-eventmanager": "2.4.0",
        "zendframework/zend-view": "2.4.0",
        "zendframework/zend-servicemanager": "2.4.0",
        "zendframework/zend-json": "2.4.0",
        "zendframework/zend-config": "2.4.0",
        "zendframework/zend-form": "2.4.0",
        "zendframework/zend-di": "2.4.0",
        "zendframework/zend-serializer": "2.4.0",
        "zendframework/zend-log": "2.4.0",
        "zendframework/zend-http": "2.4.0",
        "magento/zendframework1": "1.12.13",
        "composer/composer": "1.0.0-alpha10",
        "monolog/monolog": "1.11.0",
        "oyejorge/less.php": "1.7.0.3",
        "pelago/emogrifier": "0.1.1",
        "tubalmartin/cssmin": "2.4.8-p4",
        "solarium/solarium": "3.3.0",
        "magento/magento-composer-installer": "*",
        "braintree/braintree_php" : "2.39.0",
        "symfony/console": "~2.3 <2.7"
    },
    "require-dev": {
        "lib-libxml": "*",
        "ext-ctype": "*",
        "ext-gd": "*",
        "ext-spl": "*",
        "ext-dom": "*",
        "ext-simplexml": "*",
        "ext-mcrypt": "*",
        "ext-hash": "*",
        "ext-curl": "*",
        "ext-iconv": "*",
        "ext-intl": "*",
        "ext-xsl": "*",
        "ext-mbstring": "*",
        "phpunit/phpunit": "4.1.0",
        "squizlabs/php_codesniffer": "1.5.3",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.0.6",
        "sjparkinson/static-review": "~4.1",
        "fabpot/php-cs-fixer": "~1.2",
        "lusitanian/oauth": "~0.3"
    },
    "replace": {
        "magento/module-admin-notification": "self.version",
        "magento/module-advanced-pricing-import-export": "self.version",
        "magento/module-authorization": "self.version",
        "magento/module-authorizenet": "self.version",
        "magento/module-backend": "self.version",
        "magento/module-backup": "self.version",
        "magento/module-braintree": "self.version",
        "magento/module-worldpay": "self.version",
        "magento/module-bundle": "self.version",
        "magento/module-bundle-import-export": "self.version",
        "magento/module-cache-invalidate": "self.version",
        "magento/module-captcha": "self.version",
        "magento/module-catalog": "self.version",
        "magento/module-catalog-import-export": "self.version",
        "magento/module-catalog-inventory": "self.version",
        "magento/module-catalog-rule": "self.version",
        "magento/module-catalog-search": "self.version",
        "magento/module-catalog-url-rewrite": "self.version",
        "magento/module-catalog-widget": "self.version",
        "magento/module-checkout": "self.version",
        "magento/module-checkout-agreements": "self.version",
        "magento/module-cms": "self.version",
        "magento/module-cms-url-rewrite": "self.version",
        "magento/module-config": "self.version",
        "magento/module-configurable-import-export": "self.version",
        "magento/module-configurable-product": "self.version",
        "magento/module-contact": "self.version",
        "magento/module-cookie": "self.version",
        "magento/module-cron": "self.version",
        "magento/module-currency-symbol": "self.version",
        "magento/module-customer": "self.version",
        "magento/module-customer-import-export": "self.version",
        "magento/module-deploy": "self.version",
        "magento/module-design-editor": "self.version",
        "magento/module-developer": "self.version",
        "magento/module-dhl": "self.version",
        "magento/module-directory": "self.version",
        "magento/module-downloadable": "self.version",
        "magento/module-eav": "self.version",
        "magento/module-email": "self.version",
        "magento/module-advanced-search": "self.version",
        "magento/module-fedex": "self.version",
        "magento/module-gift-message": "self.version",
        "magento/module-google-adwords": "self.version",
        "magento/module-google-analytics": "self.version",
        "magento/module-google-optimizer": "self.version",
        "magento/module-google-shopping": "self.version",
        "magento/module-google-tag-manager": "self.version",
        "magento/module-grouped-import-export": "self.version",
        "magento/module-grouped-product": "self.version",
        "magento/module-import-export": "self.version",
        "magento/module-indexer": "self.version",
        "magento/module-integration": "self.version",
        "magento/module-layered-navigation": "self.version",
        "magento/module-log": "self.version",
        "magento/module-msrp": "self.version",
        "magento/module-media-storage": "self.version",
        "magento/module-multishipping": "self.version",
        "magento/module-newsletter": "self.version",
        "magento/module-offline-payments": "self.version",
        "magento/module-offline-shipping": "self.version",
        "magento/module-page-cache": "self.version",
        "magento/module-payment": "self.version",
        "magento/module-paypal": "self.version",
        "magento/module-persistent": "self.version",
        "magento/module-product-alert": "self.version",
        "magento/module-quote": "self.version",
        "magento/module-reports": "self.version",
        "magento/module-require-js": "self.version",
        "magento/module-review": "self.version",
        "magento/module-rss": "self.version",
        "magento/module-rule": "self.version",
        "magento/module-sales": "self.version",
        "magento/module-sales-rule": "self.version",
        "magento/module-sales-sequence": "self.version",
        "magento/module-search": "self.version",
        "magento/module-send-friend": "self.version",
        "magento/module-shipping": "self.version",
        "magento/module-sitemap": "self.version",
        "magento/module-solr": "self.version",
        "magento/module-store": "self.version",
        "magento/module-swatches": "self.version",
        "magento/module-tax": "self.version",
        "magento/module-tax-import-export": "self.version",
        "magento/module-theme": "self.version",
        "magento/module-translation": "self.version",
        "magento/module-ui": "self.version",
        "magento/module-ups": "self.version",
        "magento/module-url-rewrite": "self.version",
        "magento/module-user": "self.version",
        "magento/module-usps": "self.version",
        "magento/module-version": "self.version",
        "magento/module-webapi": "self.version",
        "magento/module-weee": "self.version",
        "magento/module-widget": "self.version",
        "magento/module-wishlist": "self.version",
        "magento/module-admin-gws": "self.version",
        "magento/module-advanced-checkout": "self.version",
        "magento/module-banner": "self.version",
        "magento/module-banner-customer-segment": "self.version",
        "magento/module-catalog-event": "self.version",
        "magento/module-catalog-permissions": "self.version",
        "magento/module-custom-attribute-management": "self.version",
        "magento/module-customer-balance": "self.version",
        "magento/module-customer-custom-attributes": "self.version",
        "magento/module-customer-finance": "self.version",
        "magento/module-customer-segment": "self.version",
        "magento/module-enterprise": "self.version",
        "magento/module-gift-card": "self.version",
        "magento/module-gift-card-account": "self.version",
        "magento/module-gift-registry": "self.version",
        "magento/module-gift-wrapping": "self.version",
        "magento/module-invitation": "self.version",
        "magento/module-logging": "self.version",
        "magento/module-multiple-wishlist": "self.version",
        "magento/module-ogone": "self.version",
        "magento/module-cybersource": "self.version",
        "magento/module-pci": "self.version",
        "magento/module-persistent-history": "self.version",
        "magento/module-price-permissions": "self.version",
        "magento/module-promotion-permissions": "self.version",
        "magento/module-reminder": "self.version",
        "magento/module-reward": "self.version",
        "magento/module-rma": "self.version",
        "magento/module-sales-archive": "self.version",
        "magento/module-advanced-catalog": "self.version",
        "magento/module-scalable-checkout": "self.version",
        "magento/module-scalable-oms": "self.version",
        "magento/module-scheduled-import-export": "self.version",
        "magento/module-target-rule": "self.version",
        "magento/module-variable": "self.version",
        "magento/module-versions-cms": "self.version",
        "magento/module-website-restriction": "self.version",
        "magento/theme-adminhtml-backend": "self.version",
        "magento/theme-frontend-blank": "self.version",
        "magento/theme-frontend-luma": "self.version",
        "magento/language-de_de": "self.version",
        "magento/language-en_us": "self.version",
        "magento/language-es_es": "self.version",
        "magento/language-fr_fr": "self.version",
        "magento/language-nl_nl": "self.version",
        "magento/language-pt_br": "self.version",
        "magento/language-zh_cn": "self.version",
        "magento/framework": "self.version",
        "trentrichardson/jquery-timepicker-addon": "1.4.3",
        "colinmollenhour/cache-backend-redis": "dev-master#193d377b7fb2e88595578b282fa01a62d1185abc",
        "colinmollenhour/credis": "dev-master#f07bbfd4117294f462f0fb19c49221d350bf396f",
        "linkorb/jsmin-php": "1.1.2",
        "phpseclib/phpseclib": "0.2.1",
        "components/jquery": "1.11.0",
        "blueimp/jquery-file-upload": "5.6.14",
        "components/jqueryui": "1.10.4",
        "twbs/bootstrap": "3.1.0",
        "tinymce/tinymce": "3.4.7"
    },
    "extra": {
        "component_paths": {
            "trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
            "colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php",
            "colinmollenhour/credis": "lib/internal/Credis",
            "linkorb/jsmin-php": "lib/internal/JSMin",
            "phpseclib/phpseclib": "lib/internal/phpseclib",
            "components/jquery": [
                "lib/web/jquery.js",
                "lib/web/jquery/jquery.min.js",
                "lib/web/jquery/jquery-migrate.js",
                "lib/web/jquery/jquery-migrate.min.js"
            ],
            "blueimp/jquery-file-upload": "lib/web/jquery/fileUploader",
            "components/jqueryui": [
                "lib/web/jquery/jquery-ui.js",
                "lib/web/jquery/jquery-ui.min.js"
            ],
            "twbs/bootstrap": [
                "lib/web/jquery/jquery.tabs.js"
            ],
            "tinymce/tinymce": "lib/web/tiny_mce"
        }
    },
    "config": {
        "use-include-path": true
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/"
        }
    },
    "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/",
            "Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/"
        }
    },
    "minimum-stability": "alpha",
    "prefer-stable": true
}
like image 751
TheBlackBenzKid Avatar asked Nov 10 '22 02:11

TheBlackBenzKid


1 Answers

Hope this helps. First, have you cloned the samples repo?

If so, then cd to the directory of the sample you want to install and run:

composer install

That should install the module. If you want to install all modules, back up one directory and run composer install.

like image 58
Steve Johnson Avatar answered Nov 14 '22 21:11

Steve Johnson