Answers.Body: <p>You need to open your index.php file and add the composer path line.
  E.g. my composer.json file is placed in the root folder and I defined the below path inside my index.php:</p>
  <pre><code>    &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();
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-18T08:40:18.283Z
Answers.LastActivityDate: 2021-11-24T07:43:14.103Z
Answers.LastEditDate: 2021-11-24T07:43:14.103Z
Answers.UserDisplayName: Soroush
Body: <p>I recently updated my CraftCMS 3 with the help of Composer.</p>
  
  <p>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. </p>
  
  <p>My composer.json is the root of craft folder. I seriously don't know how to solve my problem. </p>
  
  <p>Here's a screenshot (sorry I use Craft in french):</p>
  
  <p><a href="https://i.sstatic.net/74sxH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/74sxH.png" alt="enter image description here"></a></p>
  
  <p>Thank you!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-14T17:39:27.243Z
Comments.Text: in root plugin folder has file composer.json?
Comments.UserDisplayName: Sylvio Neto
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-14T17:47:40.670Z
Comments.Text: I am not sure I understand. I don't have a Plugin folder at the root because Craft 3.3.15 doesn't have a plugin folder.
Comments.UserDisplayName: Mikko109
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-14T17:49:32.647Z
Comments.Text: /vendor/pluginName/composer.json
Comments.UserDisplayName: Sylvio Neto
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-14T17:57:13.270Z
Comments.Text: I see what you mean. But I can't access that if the plugin I want is not installed. The plugin store won't install the plugin I want because it can't find my root composer.json.
Comments.UserDisplayName: Mikko109
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-14T18:12:36.977Z
Comments.Text: follow this tutorial: https://docs.craftcms.com/v3/config/php-constants.html
Comments.UserDisplayName: Sylvio Neto
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-15T19:02:16.883Z
Comments.Text: This does not provide an answer to the question. Once you have sufficient [reputation](https://craftcms.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://craftcms.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/8396)
Comments.UserDisplayName: Simon Kuran
Tags: <craft3><composer>
Title: "Could not find composer.json file" error in CraftCMS 3
ThreadText: # "Could not find composer.json file" error in CraftCMS 3
  
  (Asked by: username_0 on 2019-11-14)
  
  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):
  
  [![enter image description here](https://i.sstatic.net/74sxH.png)](https://i.sstatic.net/74sxH.png)
  
  Thank you!
  
  **Tags:** craft3, composer
  
  > **Comments:**
  > **username_1**: in root plugin folder has file composer.json?  
  > **username_0**: I am not sure I understand. I don't have a Plugin folder at the root because Craft 3.3.15 doesn't have a plugin folder.  
  > **username_1**: /vendor/pluginName/composer.json  
  > **username_0**: I see what you mean. But I can't access that if the plugin I want is not installed. The plugin store won't install the plugin I want because it can't find my root composer.json.  
  > **username_1**: follow this tutorial: https://docs.craftcms.com/v3/config/php-constants.html  
  > **username_2**: This does not provide an answer to the question. Once you have sufficient [reputation](https://craftcms.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://craftcms.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/8396)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-03-18. Score: 1
  
  You need to open your index.php file and add the composer path line.
  E.g. my composer.json file is placed in the root folder and I defined the below path inside my index.php:
  
  ```
      <?php
   
  //Project root path
  $root = dirname(__DIR__);
   
   
  // Load and run Craft
  define('CRAFT_BASE_PATH', $root.'/craft');
  define('CRAFT_COMPOSER_PATH', $root.'/composer.json'); **<=== this line**
  require_once $root.'/vendor/autoload.php';
  $app = require $root.'/vendor/craftcms/cms/bootstrap/web.php';
  $app->run();
  
  ```
  
  
  ---
  
  