无法创建缓存目录!请帮我在使用 Composer 创建 Laravel 项目时解决这个问题

无法创建缓存目录!请帮我在使用 Composer 创建 Laravel 项目时解决这个问题
smmm@smmm-linux:/var/www/html$ composer create-project laravel/laravel test
Cannot create cache directory /home/smmm/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/smmm/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/smmm/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache

答案1

根据您的路径,即接下来的路径/home/smmm/.composer/cache/repo/https---packagist.org,您必须尝试这些命令来解决您的问题。

  • 更改文件夹的组权限
    sudo chown -R smmm /home/smmm/.composer/cache/repo/https---packagist.org
  • 更改文件夹
    sudo chown -R smmm /home/smmm/.composer/cache/files/
  • 然后为整个作曲家的目录更改权限
    sudo chown -R smmm /home/smmm/.composer

此致

相关内容