"Could not find composer.json file" error in CraftCMS 3
You need to open your index.php file and add composer path line.
E.g. my composer.json file is placed in root folder and I defined below path inside my index.php:
    &lt;?php
 
//Project root path
$root = dirname(__DIR__);
 
 
// Load and run Craft
define('CRAFT_BASE_PATH', $root.'/craft');
define('CRAFT_COMPOSER_PATH', $root.'/composer.json'); &lt;======= this line
require_once $root.'/vendor/autoload.php';
$app = require $root.'/vendor/craftcms/cms/bootstrap/web.php';
$app-&gt;run();