Composer could not find a composer.json file in /home/<user>

I havebeen trying to update Composer and I kept coming up with this error.  After fighting this issue for about 20 minutes, checking various references on Google and being totally confused (as my understanding of Composer is not that great) I came to an easy fix.  Apparently Composer looks for composer.json file  in the directory you are in.  Next it checks your home directory and then uses that in it's error reporting.  This is good for sending you in the wrong direction, but now understanding this everthing makes total sense, and that is to make sure you update composer from within the code of the site, otherwise the composer.json file is not available and without it, composer is unable to update.

 

Tags: 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.