Magento 2-部署magento-sample-data时可卸载的一组软件包


28

在安装Magento 2之后,我已按照此Magento DevDocs教程安装示例数据。

但是执行最后一条命令后./bin/magento sampledata:deploy,出现以下错误:

./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.

一直找不到解决方案,说实话,我对作曲家的知识严重缺乏。任何帮助都将受到欢迎。


请参阅@rnli答案。我认为到目前为止,这是最好的解决方案。它为我工作。
Rajeev K Tomy

Answers:


19

我也一直在努力安装示例数据。似乎目前在这里已无法解决问题(2015年10月),并且devdocs中指令对我也不起作用。我遇到了相同的作曲家问题,magento sampledata:install甚至还没有。

相反,我一直遵循示例数据的自述文件上的“来自GitHub存储库”说明:

只需将存储库克隆到某个地方(可以在您的项目文件夹外部,因为该工具负责符号链接各个模块):

git clone https://github.com/magento/magento2-sample-data.git ~/sample-data

然后运行“安装程序”脚本:

php -f ~/sample-data/dev/tools/build-sample-data.php -- --ce-source="$PATH_TO_YOUR_MAGENTO2_PROJECTROOT"

之后,运行更新脚本:

cd $PATH_TO_YOUR_MAGENTO2_PROJECTROOT
bin/magento setup:upgrade

并且您应该看到正在安装的示例数据(需要一些时间...):

[...]
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..
[...]

不要忘记清除缓存并修复权限,您现在应该在后端和前端中看到所有示例数据。


但是,当我运行安装程序升级时,PHP Fatal error: Interface 'Magento\Framework\Serialize\SerializerInterface' not found存在SerializerInterface.php文件时,错误显示在终端中。
zed Blackbeard

27

有同样的问题。通过使用以下命令转到根目录并为composer指定存储库进行了修复(使用https以避免composer警告):

composer config repositories.magento composer https://repo.magento.com

之后

cd bin
php magento sampledata:deploy

按预期工作


啊..美丽。像魅力一样工作
拉杰夫·托米

这应该添加到安装/自述文件中。
编码

您介意在链接中用https替换http吗?当我尝试当前表格时,作曲家拒绝连接它,因为它不安全。
撒尿

1
composer config repositories.magento composer repo.magento.com/packages.json
Nehal,

4

最近的代码更改使使用Magento 2 CE GitHub开发分支安装示例数据成为可能,前提是您克隆了Magento 2和示例数据存储库。

在安装GA时,将通过命令行选项和Composer选项来推广这种安装示例数据的方法。但是,目前,对于AFAIK,这是通过developer分支安装示例数据的唯一方法。

简单来说:

  1. 克隆Magento 2 CE GitHub存储库(默认为develop分支)。
  2. 从项目根目录运行“ composer install”。
  3. 克隆Magento 2样本数据存储库(默认为develop分支)。
  4. 链接样本数据存储库。(php -f sample-data-repo / dev / tools / build-sample-data.php---ce-source =“ your-Magento-CE-install-dir”)
  5. 在样本数据存储库中设置权限和所有权。
  6. 使用CLI或设置向导安装Magento。(安装向导不再具有“ 安装示例数据”复选框。)

请注意,如果您运行安装向导,则可能会看到大约90%完成的异常。如果是这样,请再次设置文件系统权限和所有权(最有可能是root用户)。

详细信息:http : //devdocs.magento.com/guides/v2.0/install-gde/install/web/install-web-sample-data.html


4

在第一部分中"minimum-stability": "beta",在许可证之前添加。


已经做到了,但是没有帮助,同样的错误
Sander Mangel

sampledata:deploy不是命令的名称,它是“ magento sampledata:install <您的Magento管理员用户名>”
Steve Johnson

@SteveJohnson实际上我没有install可用的命令
Sander Mangel


0

以防万一您也可以使用此替代方法:

composer config repositories.0 composer https://repo.magento.com

然后:

magento sampledata:deploy

系统会提示您输入用户名/密码:使用magento市场帐户中的public_key / private_key

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.