无法在 ubuntu 中安装 Laravel

无法在 ubuntu 中安装 Laravel

当我composer在终端中运行时,

Cannot create cache directory /home/varun/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/varun/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/varun/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache

答案1

如果该文件夹归所有root,即使您具有管理员权限,您仍然没有权限,sudo在安装时使用时就会发生这种情况composer

可以通过以下方法解决

sudo chown -R $USER $HOME/.composer

相关内容