"Could not find composer.json file" error in CraftCMS 3 I recently updated my CraftCMS 3 with the help of Composer.

When I try to install a plugin with the plugin store, I get an error saying that Craft couldn't find my composer.json file. He proposes me to define the  CRAFT_COMPOSER_PATH in index.php. But, when I do, I still get the same error. 

My composer.json is the root of craft folder. I seriously don't know how to solve my problem. 

Here's a screenshot (sorry I use Craft in french):



Thank you!
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();