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.