title: How to fix Error: capacitor.config.json does not exist, did you setup capacitor in your project root? when adding electron with capacitor in ionic?
body: <p>I have a ionic-react project a I'm trying to add electron support using capacitor by doing:</p>
  <pre><code>ionic start blah tabs --type=react --capacitor
  npx cap add @capacitor-community/electron
  </code></pre>
  <p>but it throws this error:</p>
  <pre><code>Error: capacitor.config.json does not exist, did you setup capacitor in your project root?
      at Object.n [as doAdd] (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:6:1016)
      at C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:363
      at Object.g [as runTask] (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:2:1888)
      at i (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:311)
      at C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:718
      at Object.parcelRequire.Focm../common (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:915)
      at f (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:1:468)
      at parcelRequire.FoEN (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:1:771)
      at Object.&lt;anonymous&gt; (C:\Users\My-Name\blah\node_modules\@capacitor-community\electron\dist\cap-scripts.js:1:1023)
      at Module._compile (node:internal/modules/cjs/loader:1109:14)
  </code></pre>
  <p>I am changing the env variable INIT_CWD as <code>set INIT_CWD=C:\Users\My-Name\blah\node_modules\@capacitor-community\electron</code> following <a href="https://github.com/capacitor-community/electron/issues/76" rel="nofollow noreferrer">https://github.com/capacitor-community/electron/issues/76</a> but nothing seems to be working. The project just had capacitor.config.ts so I added the capacitor.config.json myself:</p>
  <pre><code>{
    &quot;appId&quot;: &quot;io.ionic.starter&quot;,
    &quot;appName&quot;: &quot;blah&quot;,
    &quot;bundledWebRuntime&quot;: false,
    &quot;npmClient&quot;: &quot;npm&quot;,
    &quot;webDir&quot;: &quot;www&quot;,
    &quot;plugins&quot;: {
      &quot;SplashScreen&quot;: {
        &quot;launchShowDuration&quot;: 0
      }
    },
    &quot;cordova&quot;: {}
  }
  </code></pre>
  <p>I've updated versions of node,npm and ionic kindly help me with this issue.</p>