首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Uncaught : Magento\InventoryComposerInstaller的返回值必须是Magento\InventoryComposerInstaller\void的实例,没有返回

Uncaught : Magento\InventoryComposerInstaller的返回值必须是Magento\InventoryComposerInstaller\void的实例,没有返回
EN

Stack Overflow用户
提问于 2019-02-25 13:46:36
回答 1查看 3.8K关注 0票数 1

我正试图通过我的网络服务器上的作曲家安装Magento 2。必须将以下内容添加到composer.json文件中,以便在使用php版本的情况下使一切在公平的环境下工作:

代码语言:javascript
复制
"config": {
    "platform": {
        "php": "7.2.14"
    }
} 

然后我开始让事情发生当我composer install

代码语言:javascript
复制
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 392 installs, 0 updates, 0 removals
  - Installing magento/magento-composer-installer (0.1.13): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.10.0): Downloading (100%)
  - Installing zendframework/zend-stdlib (2.7.7): Downloading (100%)
  - Installing zendframework/zend-hydrator (1.1.0): Downloading (100%)
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing container-interop/container-interop (1.2.0): Downloading (100%)
  - Installing zendframework/zend-validator (2.11.1): Downloading (100%)
  - Installing zendframework/zend-escaper (2.6.0): Downloading (100%)
  - Installing zendframework/zend-uri (2.6.1): Downloading (100%)
  - Installing psr/http-message (1.0.1): Downloading (100%)
  - Installing zendframework/zend-diactoros (1.8.6): Downloading (100%)
  - Installing zendframework/zend-loader (2.6.0): Downloading (100%)
  - Installing zendframework/zend-http (2.8.4): Downloading (100%)
  - Installing zendframework/zend-psr7bridge (0.2.2): Downloading (100%)
  - Installing zendframework/zend-servicemanager (2.7.11): Downloading (100%)
  - Installing zendframework/zend-filter (2.9.1): Downloading (100%)
  - Installing zendframework/zend-inputfilter (2.10.0): Downloading (100%)
  - Installing zendframework/zend-form (2.13.0): Downloading (100%)
  - Installing zendframework/zend-eventmanager (2.6.4): Downloading (100%)
  - Installing zendframework/zend-code (3.3.1): Downloading (100%)
  - Installing zendframework/zend-console (2.7.0): Downloading (100%)
  - Installing zendframework/zend-mvc (2.7.15): Downloading (100%)
  - Installing zendframework/zend-math (2.7.1): Downloading (100%)
  - Installing zendframework/zend-crypt (2.6.0): Downloading (100%)
  - Installing tedivm/jshrink (v1.3.1): Downloading (100%)
  - Installing symfony/process (v4.1.11): Downloading (100%)
  - Installing symfony/console (v4.1.11): Downloading (100%)
  - Installing oyejorge/less.php (v1.7.0.14): Downloading (100%)
  - Installing psr/log (1.1.0): Downloading (100%)
  - Installing monolog/monolog (1.24.0): Downloading (100%)
  - Installing magento/zendframework1 (1.14.1): Downloading (100%)
  - Installing symfony/finder (v4.2.3): Downloading (100%)
  - Installing symfony/filesystem (v4.2.3): Downloading (100%)
  - Installing seld/phar-utils (1.0.1): Downloading (100%)
  - Installing seld/jsonlint (1.7.1): Downloading (100%)
  - Installing justinrainbow/json-schema (5.2.8): Downloading (100%)
  - Installing composer/xdebug-handler (1.3.2): Downloading (100%)
  - Installing composer/spdx-licenses (1.5.0): Downloading (100%)
  - Installing composer/semver (1.4.2): Downloading (100%)
  - Installing composer/ca-bundle (1.1.4): Downloading (100%)
  - Installing composer/composer (1.8.4): Downloading (100%)
  - Installing colinmollenhour/credis (1.10.0): Downloading (100%)
  - Installing colinmollenhour/php-redis-session-abstract (v1.4.0): Downloading (100%)
  - Installing magento/framework (102.0.0): Downloading (100%)
  - Installing magento/inventory-composer-installer (1.0.3): Downloading (100%)  
PHP Fatal error:  Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php:69
Stack trace:
#0 /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php(88): Magento\InventoryComposerInstaller\Plugin->initModuleDeployment()
#1 /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php(82): Magento\InventoryComposerInstaller\Plugin->getModuleDeployment()
#2 [internal function]: Magento\InventoryComposerInstaller\Plugin->onPackageChange(Object(Composer\Installer\PackageEvent))
#3 phar:///usr/lib/plesk-9.0/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Installer\PackageEvent))
#4 phar:///usr/lib/plesk-9.0/comp in /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php on line 69

Fatal error: Uncaught TypeError: Return value of Magento\InventoryComposerInstaller\Plugin::initModuleDeployment() must be an instance of Magento\InventoryComposerInstaller\void, none returned in /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php:69
Stack trace:
#0 /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php(88): Magento\InventoryComposerInstaller\Plugin->initModuleDeployment()
#1 /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php(82): Magento\InventoryComposerInstaller\Plugin->getModuleDeployment()
#2 [internal function]: Magento\InventoryComposerInstaller\Plugin->onPackageChange(Object(Composer\Installer\PackageEvent))
#3 phar:///usr/lib/plesk-9.0/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Installer\PackageEvent))
#4 phar:///usr/lib/plesk-9.0/comp in /var/www/vhosts/blah/project-community-edition/vendor/magento/inventory-composer-installer/src/Plugin.php on line 69

我没有运气到处寻找帮助,在这个问题上与马根托联系。一些与Composer相关的类似问题(但没有Magento )要求用户提供关于composer版本和php版本等的进一步信息。下面是在这些线程中请求的信息:

代码语言:javascript
复制
$ composer --version
Composer version 1.9-dev (blah) 2019-02-08 16:02:33

$ composer show composer/composer | grep versions
versions : * 1.8.4

$ composer depends composer/composer
magento/framework  102.0.0  requires  composer/composer (^1.6)

$ php -version
PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )

Plesk中的PHP版本: 7.2.14

phpinfo()中列出的PHP版本: 7.2.14

目前,我对如何处理这个问题感到困惑。如有任何建议或建议,将不胜感激。这是我第一次使用Composer进行安装,而且由于缺乏对linux/bash等方面的理解/经验,我通常会尽量避免使用命令行内容。

提前感谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-25 14:04:15

此错误可以实现为PHP兼容性

  • Magento 2.3.1+PHP 7.1PHP 7.2
  • Magento 2.3.0PHP 7.1
  • Magento 2.2PHP 7.1PHP 7.0
  • Magento 2.1PHP 7.1PHP 7.0PHP 5.6
  • Magento 2.0PHP 7.0PHP 5.6PHP 5.5

检查您的PHP版本,并在需要时升级或降级PHP。

如果没有的好版本,您将永远无法使Magento 2工作得很好。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54867654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档