69

You can try below command: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.7 /installation/directory/path


64

Edit the composer.json file on root folder and change the version of magento in line 5: "version": "2.0.1", and under "require" "require": { "magento/product-community-edition": "2.0.1", Now run: composer update Then run: php bin/magento setup:upgrade And finally re-deploy the static files, which for me is this command: php bin/magento setup:static-...


49

Updating/Upgrading to Magento 2.0.5 (via composer) php bin/magento maintenance:enable composer require magento/product-community-edition 2.0.5 --no-update composer update rm -rf var/di var/generation php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento indexer:reindex php bin/magento maintenance:disable ...


28

Had the same problem. Fixed with going to the root directory and specifying the repositories for composer with the following command (use https to avoid composer warning): composer config repositories.magento composer https://repo.magento.com After that cd bin php magento sampledata:deploy worked as intended


24

Update - September 2017: Magento 2.2 now officially supports PHP 7.1, so that's the Magento version you should aim for from now on if PHP 7.1 is something you want or need on your platform. Original - October 2016: I am actually wondering if the DevDocs documentation is a mistake and maybe they meant PHP 7.0.10 instead of 7.1.0, that would make more sense ...


19

I've also been struggling to install the sample data. It appears that somthing is currently broken here (Oct 2015) and the instructions in the devdocs didn't work for me either. I was experiencing the same composer issues and the magento sampledata:install isn't even there. Instead I've been following the "From GitHub Repository" instructions on the sample ...


18

Searching the codebase for UninstallInterface gives \Magento\Setup\Model\UninstallCollector. If you search for UninstallCollector then, you'll find that's used in \Magento\Setup\Console\Command\ModuleUninstallCommand. Particularly relevant: $uninstalls = $this->collector->collectUninstall(); $setupModel = $this->objectManager->get('...


18

app/code is missing because all Magento modules are put to vendor directory for 3rd-party developers convenience, so they do not have to mix their own code with the core. Now it is easy to develop custom modules without committing the whole Magento core to your GIT repository (unlike in Magento 1).


17

It seems that this module need a special library. If we take a look into the composer.json file located in the module files we can find that he required this library : "require" : { "ebizmarts/mailchimp-lib": "3.0.*" } So in my case the only solution was to install this library via composer and then install the module also via composer. To ...


16

It appears that this error might appear when a MySQL database is empty, but the env.php file is present. (Possibly because you had setup Magento, but for some reason, database was deleted.) To fix this you can add --cleanup-database flag to setup:install command (For me, it went ok only after the second try.), or delete the env.php file indeed, which I don't ...


15

When upgrading through composer, you can choose the version of which you need to upgrade via a composer upgrade. For example: composer require magento/product-community-edition 2.1.2 --no-update The same command can be run if using Enterprise. For example: composer require magento/product-enterprise-edition 2.0.6 --no-update After running the relevant ...


14

Magento 2 advocates the use of composer for managing modules, when you install a module through composer it is added to vendor/<vendor-name>/<module>. You should not edit any code inside the vendor folder. If you’re developing your own module or if you want to continue development of an existing module you add your files or clone a git repo to ...


13

I have set up a structure at our agency that allows us to use Composer to deploy all our Magento sites. This might be a bit of overkill for the question you asked but here's a basic overview of the structure anyway: Repository structure Below is the folder structure of the 'parent' repository. It contains the composer JSON and lock files and other ...


12

This is the way to go: "autoload": { "files": [ "registration.php" ], "psr-4": { "Amit\\SamplePage\\": "" } } The map function in Composer: "extra": { "map": [ [ "*", "Amit/SamplePage" ] ] } forces the extension to be installed in app/code. This was used in ...


12

As the existing answers are not quite clear about it: this is not an error, only a warning. The abandoned package still exists, and Magento already replaced the dependency somewhere in version 2.1 so you don't have to worry about it. There seem to be cases where the warning prevents further installations. In that case, or if you want to get rid of the ...


11

Custom modules should not be developed in vendor directory. Copy content from vendor/magento/magento2-base to the root of the project, create custom .gitignore as described here and initialize new git repository. Then develop custom module under app/code/VendorName/ModuleName. Later, when you decide to distribute the module, it will have to be packaged and ...


10

Quoted from https://alankent.wordpress.com/2014/08/02/magento-2-progress-towards-installation-via-composer/: What is packages.magento.com? This is a Satis repository of the Magento 2 packages. This might change around by final release, but it gets the packages out there for now without polluting packagist.org with our weekly alpha code drops. Note ...


10

Install module via composer is the best way to Magento 2. Becuase there are many advantages if we install module via composer. If you want to upgrade module you just need to change the version in composer.json file and run composer update command at the rootMagentoento. While in manual installation you need to first download module and replace old files and ...


9

Follow below steps to install magento2 extension (2.1.7) cd <your Magento install dir> composer require <component-name>:<version> --no-update composer update bin/magento setup:upgrade bin/magento setup:di:compile Source: http://devdocs.magento.com/guides/v2.1/cloud/howtos/install-components.html


9

Do I need to manually look at my module everytime I use a piece of core Magento code and add a require:... line to composer.json? Yes, every time in your code you use anything from a core module you need to add it to your composer's require. As you likely want your load order to be after the core module I would also suggest adding it to your module.xml file ...


9

There are two possibilities: The devdocs are wrong and PHP 7.1 is not supported The requirement in composer.json is wrong. Since Magento 2.1 was released before PHP 7.1, it is most likely option (2) and the requirement in composer.json has just not been updated yet. But you can ignore it and install Magento anyways, if you add the --ignore-platform-reqs ...


9

You can uninstall a module through composer if it was installed using composer. If yes then issue command: php bin/magento module:uninstall -r <Vendor>_<Module> -r flag removes module data. then issue: php bin/magento setup:upgrade If module was not installed through composer: remove the module directory app/code/<Vendor>/<Module&...


9

Maybe my code can be useful for you (tested in the observer): /** * @var \Magento\Framework\App\DeploymentConfig */ protected $deploymentConfig; /** * @var \Magento\Framework\Component\ComponentRegistrarInterface */ protected $componentRegistrar; /** * @var \Magento\Framework\Filesystem\Directory\ReadFactory */ protected $readFactory; /** * @param ...


8

I don't have a workaround and it wasn't an issue for me yet, but I have a proposal that could work: You need to maintain separate version branches to target different Magento versions. Deploying different files in the same version depending on some composer magic is not going to work well. So your extesion could have a 1.x branch for compatibility with ...


8

That is an outdated part of code which is not even used in magento 2. It resulted from the fork of the composer installer for magento 1 which has multiple additional features to extend magento 1 via composer. This specific feature allowed to put php libraries installed via composer into a director, analog to \lib\ and also added a static autoloading for ...


8

First part is how to do this from an extension builder perspective. I'm leaving the second part as reference for project builders. Extension builder answer: You can't do this from within an extension which has ... "type": "magento2-module" ... in its composer.json file. You will need to create a new/extra extension for these files. This new extension ...


8

I'm answering my own question, so it will be beneficial for someone else later, To be able to install in a custom path, your module must support composer/installers so add it to your module's require section, eg: "require": { "magento/magento-composer-installer": "*", "composer/installers": "~1.0" } and then give your module a custom path in extra ...


8

Magento 2 uses Composer, a PHP dependency manager, to package components and product editions. Composer is a dependency management for PHP and in Magento 2, the composer plays the role in gathering components and product editions. When using the Magento 2 composer, there is no requirement of storing all code of each component, and you only need to create ...


8

First be sure you are running PHP 7.1 or 7.2 Update your composer run those commandes: composer require magento/product-community-edition=2.3.0 --no-update Specify additional packages for composer Run this composer require --dev phpunit/phpunit:~6.2.0 friendsofphp/php-cs-fixer:~2.10.1 lusitanian/oauth:~0.8.10 pdepend/pdepend:2.5.2 sebastian/phpcpd:~3....


7

If you use the alternative composer installers by AOE, you can add a composer package of type magento-source as dependency and specify where the code should be placed: "extra":{ "installer-paths": { "www/" : [ "type:magento-source" ], ".modman/{$vendor}_{$name}/" : [ "type:magento-module" ] }, For the Magento core you will need a ...


Only top voted, non community-wiki answers of a minimum length are eligible