The question:
I’ve followed this Magento DevDocs tutorial to install sample data after installing Magento 2.
But after executing the last command ./bin/magento sampledata:deploy
I get the following error:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
Problem 3
- The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
Problem 4
- The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
Problem 5
- The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
Problem 6
- The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
Problem 7
- The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
Problem 8
- The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.
Problem 9
- The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
Problem 10
- The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
Problem 11
- The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
Problem 12
- The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
Problem 13
- The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
Problem 14
- The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
Problem 15
- The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
Problem 16
- The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
Problem 17
- The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
Problem 18
- The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
Problem 19
- The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Haven’t been able to find a solution and to be honest my knowledge of composer is seriously lacking. Any help would be welcome.
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
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 data’s readme file:
Just clone the repo somewhere (can be outside your project folder, since the tool is taking care of symlinking the individual modules):
git clone https://github.com/magento/magento2-sample-data.git ~/sample-data
Then run the “installer” script:
php -f ~/sample-data/dev/tools/build-sample-data.php -- --ce-source="$PATH_TO_YOUR_MAGENTO2_PROJECTROOT"
After that run the update script:
cd $PATH_TO_YOUR_MAGENTO2_PROJECTROOT
bin/magento setup:upgrade
And you should see the sample data being installed (takes a while…):
[...]
Module 'Magento_DownloadableSampleData':
Installing data..
Module 'Magento_ThemeSampleData':
Installing data..
Module 'Magento_OfflineShippingSampleData':
Installing data..
Module 'Magento_ConfigurableSampleData':
Installing data..
Module 'Magento_BundleSampleData':
Installing data..
Module 'Magento_ProductLinksSampleData':
Installing data..
Module 'Magento_ReviewSampleData':
Installing data..
[...]
Don’t forget to clear caches and fix permissions and you should see all the sample data in the backend and the frontend now…
Method 2
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
Method 3
Recent code changes make it possible to install sample data using the Magento 2 CE GitHub develop branch provided you clone the Magento 2 and sample data repositories.
This method of installing sample data will be augumented by the time of GA with a command-line option and a Composer option; however, currently, AFAIK, this is the only way to install sample data with the develop branch.
In brief:
- Clone the Magento 2 CE GitHub repository (develop branch is the default).
- Run ‘composer install’ from the project root.
- Clone the Magento 2 sample data repository (develop branch is the default).
- Link the sample data repositories. (php -f sample-data-repo/dev/tools/build-sample-data.php — –ce-source=”your-Magento-CE-install-dir”)
- Set permissions and ownership in the sample data repository.
- Install Magento using either the CLI or Setup Wizard. (Setup Wizard no longer has an Install Sample Data check box.)
Note that if you run the Setup Wizard, you might see exceptions at about 90% complete. If so, set file system permission and ownership again (most likely as root).
Details: http://devdocs.magento.com/guides/v2.0/install-gde/install/web/install-web-sample-data.html
Method 4
In the first section, add "minimum-stability": "beta"
, before license.
Method 5
https://packages.magento.com is the old package url for Magento change the composer.json file to https://repo.magento.com
Method 6
Just in case you can use this alternative too:
composer config repositories.0 composer https://repo.magento.com
and then:
magento sampledata:deploy
you’ll be prompted for username/password : use public_key/private_key from your magento marketplace account
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0