In Factory.php line 699: The HOME or COMPOSER_HOME environment variable must be set for composer to

Viewed 15

I'm trying to deploy Laravel 9 project with github actions. here's my .yml file

 steps:
      - uses: actions/checkout@v3
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: "8.1"
      - name: Copy .env
        run: php -r "file_exists('.env') || copy('.env.example', '.env');"
      - name: Install Dependencies
        run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

However, it's failing in composer install with following error:

In Factory.php line 699:
                                                                               
  The HOME or COMPOSER_HOME environment variable must be set for composer to   
  run correctly                                                                
                                                                               

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

Error: Process completed with exit code 1.

I've tried this solution, however it's not working.

Server: Ubuntu 18.04
Composer version: 2
Laravel version: 9
0 Answers
Related