Cannot create cache directory .. or directory is not writable. Proceeding without cache in Laravel

Karthik picture Karthik · Mar 8, 2016 · Viewed 136.7k times · Source

I created a new Laravel project. When I go to the terminal to install the dependecies composer displays the following warning:

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

Answer

Jim M picture Jim M · Sep 2, 2016

When you installed composer pretty sure you used $ sudo command because of that the ~/.composer folder was created by the root.

Run this to fix the issue:

$ sudo chown -R $USER $HOME/.composer