PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, April 18, 2022

[FIXED] When installing Laravel I got an error: "./composer.json is not writable."

 April 18, 2022     installation, laravel     No comments   

Issue

This is the command I run:

composer global require "laravel/installer"

and this is the text and error I got after that:

Changed current directory to /home/dimitar/.composer
./composer.json is not writable.

I'm running Ubuntu 16.04 LTS and PHP 7 and Composer version 1.3.0 and running this command from my home folder.


Solution

Check the owner of composer.json.

ls -lh ~/.composer/composer.json

If it's 'root', run:

sudo chown -R yourusername:yourusername ~/.composer/composer.json

While in the .composer folder, check the 'cache' folder owner. If it's 'root', re-run above command but switch composer.json to the cache. Otherwise, you may end up with a 'Cannot create cache directory' warning.



Answered By - PelleLV
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing