magento2: Magento 2.3.0: After composer installation sampledata can't be installed from command line

Preconditions

  1. Magento 2.3.0
  2. Install Magento with composer
  3. Remove the version number from the composer.json file in the root of the project.

Steps to reproduce

  1. Install Magento with composer using the following command composer create-project --repository=https://repo.magento.com/ magento/project-community-edition <install-directory-name>
  2. After successful installation and setup run the following command to install the sample data: bin/magento sampledata:deploy

Expected result

  1. Sample data deploys to the freshly installed Magento environment.

Actual result

  1. Command throws the following error:
bin/magento sampledata:deploy
Git installations must deploy sample data from GitHub; see https://devdocs.magento.com/guides/v2.3/install-gde/install/sample-data-after-clone.html for more information.

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 19 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I did some more digging into this issue and found out why it’s not installing for me. My root composer.json does not have a version number in it. The command sampledata:deploy is checking if there is a version number present in the root composer.json file. When a version number is not found / present it will throw the error shown in this issue. This happens on the following line in the code: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/SampleData/Console/Command/SampleDataDeployCommand.php#L87

Please note that according to the Composer documentation, the version number is not required and should be omitted. More information here: https://getcomposer.org/doc/04-schema.md#version The documentation also states: Specifying the version yourself will most likely end up creating problems at some point due to human error.

So a better solution is the check if the file /app/code/Magento/SampleData/composer.json file exists in order to determine if the installation is installed with composer or cloned from Github.

Hi @dverkade. Thanks for the report. I’m not able to reproduce following steps you described. Please see attachment of screen: composer-sd