title: Error: spawn npm ENOENT
body: <p>I have an JS app. It works good on linux but in windows 10 I am getting an error.</p>
  
  <pre><code>events.js:161
    throw er; // Unhandled 'error' event
    ^
  
  Error: spawn npm ENOENT
      at exports._errnoException (util.js:1028:11)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
      at onErrorNT (internal/child_process.js:359:16)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)
      at Module.runMain (module.js:607:11)
      at run (bootstrap_node.js:422:7)
      at startup (bootstrap_node.js:143:9)
      at bootstrap_node.js:537:3
  </code></pre>
  
  <p>and the code which is incorrect is this</p>
  
  <pre><code>const spawn = require('child_process').spawn;
  
  const watching = [
    // {service: "babel-watch"},
    {service: "webpack-watch"},
    // {service: "sass-watch"},
    {service: "server-watch"}
  ];
  
  watching.forEach(({service}) =&gt; {
    const child = spawn('npm', ['run', service]);
    child.stdout.on('data', d =&gt; console.log(d.toString()));
    child.stderr.on('data', d =&gt; console.log(d.toString()));
  });
  </code></pre>
  
  <p>I found the reason of this error in <a href="https://github.com/nodejs/node-v0.x-archive/issues/5841" rel="noreferrer">github</a> I guess the problem is spawn <a href="https://nodejs.org/api/child_process.html" rel="noreferrer">nodejs spawn Doc</a> which have didn't work correctly in windows. But I don't know how to modify this snippet of code to make it work. Can someone help me ?</p>