我正在尝试使用github操作部署Laravel 9项目。这是我的.yml文件
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
但是,它在composer install
中失败,错误如下:
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.
我已经尝试了this解决方案,但它不工作.
Server: Ubuntu 18.04
Composer version: 2
Laravel version: 9
1条答案
按热度按时间6ie5vjzr1#
在Ubuntu 20.04 LTS上,我遇到了类似的问题。
对我有效的解决方案是运行以下命令(以非root身份运行):
这允许我再次使用composer,但是破坏了缓存目录。
希望这个有用。