無法建立快取目錄!使用 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

此致

相關內容