Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

successful install of composer, but message shows: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly

I have installed composer on a Ubuntu vagrant box, running php 7.0 (which was just installed prior to this). Trying simply composer, or the full path php /usr/local/bin/composer both result in the following error:

The HOME or COMPOSER_HOME environment variable must be set for 
composer to run correctly

I am unfamiliar with which env variable to set (or both), what value it should be set to, or where it should be set/declared! I've searched quite a few forums including github, but I'm not seeing this information. Appreciate your help.

error after composer install

UPDATE: Also tried this, same message:

curl -sS https://getcomposer.org/installer | php
like image 743
Oliver Williams Avatar asked Nov 09 '17 06:11

Oliver Williams


1 Answers

The following worked for me, successfully allowing me to see the composer output:

export COMPOSER_HOME="$HOME/.config/composer";
composer

Note that I was able to just run composer in the project folder, didn't need to use the full path.

REFERENCE: https://github.com/consolidation/cgr/issues/10

(javi-dev commented on Feb 24)

like image 178
Oliver Williams Avatar answered Oct 18 '22 19:10

Oliver Williams