Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 2 Fatal Error when running composer:install

  1. Clone fresh Magento 2 instance; 2.Run composer:install

Fatal Error: PHP Fatal error: Uncaught Error: Undefined class constant 'PRE_COMMAND_RUN'

like image 836
mageto2user Avatar asked Mar 28 '20 06:03

mageto2user


2 Answers

This was an issue with Composer, By installing latest version of Composer solved it. The bug for the constant variable PRE_COMMAND_RUN is raised and closed.

like image 99
Ramesh Avatar answered Sep 19 '22 10:09

Ramesh


You need install latest version of composer, upgrade steps given below.

-- Remove existing composer

Debian/Ubuntu

sudo apt-get remove composer

Centos/Redhat

sudo yum remove composer

Get the latest composer using wget.

cd /tmp
sudo curl -sS https://getcomposer.org/installer | php

Move composer executable to PATH so it can be accessible globally.

sudo mv composer.phar /usr/local/bin/composer

To check the composer version

composer -V
like image 32
Vaibhav Panmand Avatar answered Sep 19 '22 10:09

Vaibhav Panmand