title: Electron NodeJS spawn error when running certain commands: spawn ENOENT
body: <p>So, I'm trying to use <strong>spawn</strong> in my Electron application to run the <code>flutter --version</code> command.
  This command works perfectly fine on my terminal.</p>
  <p>Every solution I've seen implies I don't have it in my <code>process.env.PATH</code> variable. But when I do a <code>console.log( process.env.PATH );</code>, the path to my Flutter command is there.</p>
  <p>Here is the current code I'm trying to execute:</p>
  <pre><code>const flutterVer = spawn('flutter', ['--version', '/c']);
  
  flutterVer.stdout.on('data', (data) =&gt; {
    console.log(`stdout: ${data}`);
  });
  </code></pre>
  <p>Which returns:</p>
  <pre><code>Uncaught Error: spawn flutter ENOENT
      at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
      at __node_internal_errnoException (node:internal/errors:594:12)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
      at onErrorNT (node:internal/child_process:477:16)
      at processTicksAndRejections (node:internal/process/task_queues:83:21)
  </code></pre>
  <p>I tried testing with another command, like <code>git --version</code>, and that worked perfectly fine.</p>