title: Why is npm react-scripts producing a syntax error when I run `npm run start`?
body: <p>So I've been working on a full stack React app for a few months now. For some reason, seemingly out of no where, when I tried to run <code>npm run start</code> on the command line, it produced the following error;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// npm run start
  
  &gt; pair@0.1.0 start /Users/eden/Documents/GitHub/Pair./pair
  &gt; react-scripts start
  
  /Users/eden/Documents/GitHub/Pair./pair/node_modules/react-dev-utils/WebpackDevServerUtils.js:166
    compiler.hooks.done.tap('done', async stats =&gt; {
                                    ^^^^^
  
  SyntaxError: missing ) after argument list
      at createScript (vm.js:56:10)
      at Object.runInThisContext (vm.js:97:10)
      at Module._compile (module.js:542:28)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Module.require (module.js:497:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (/Users/eden/Documents/GitHub/Pair./pair/node_modules/react-scripts/scripts/start.js:45:5)
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! pair@0.1.0 start: `react-scripts start`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the pair@0.1.0 start script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/eden/.npm/_logs/2019-02-11T01_36_36_244Z-debug.log</code></pre>
  </div>
  </div>
  </p>
  
  <p>I've tried the following approaches;</p>
  
  <ul>
  <li>uninstalling/reinstalling node </li>
  <li>uninstalling/reinstalling npm </li>
  <li>Ensuring node and npm were version 6 or higher </li>
  <li>deleting <code>node_modules</code> and <code>package-lock.json</code> and re-running <code>npm-i</code> </li>
  <li>uninstalling/reinstalling react-scripts </li>
  <li>downgrading react-scripts </li>
  <li>running <code>npm install --save react react-dom react-scripts</code></li>
  <li>uninstalling/reinstalling react-dev-utils</li>
  </ul>
  
  <p>I even tried copying/pasting contents of <code>WebpackDevServerUtils.js</code> in the <a href="https://github.com/facebook/create-react-app" rel="noreferrer">GitHub homepage of react-dev-utils</a> to my local <code>node_modules/react-dev-utils/WebpackDevServerUtils.js</code> to resolve the syntax error.</p>
  
  <p>I have no idea why this is happening. Below is the log of this run;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>0 info it worked if it ends with ok
  1 verbose cli [ '/Users/eden/.nvm/versions/node/v6.11.2/bin/node',
  1 verbose cli   '/usr/local/bin/npm',
  1 verbose cli   'run',
  1 verbose cli   'start' ]
  2 info using npm@6.4.1
  3 info using node@v6.11.2
  4 verbose run-script [ 'prestart', 'start', 'poststart' ]
  5 info lifecycle pair@0.1.0~prestart: pair@0.1.0
  6 info lifecycle pair@0.1.0~start: pair@0.1.0
  7 verbose lifecycle pair@0.1.0~start: unsafe-perm in lifecycle true
  8 verbose lifecycle pair@0.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/eden/Documents/GitHub/Pair./pair/node_modules/.bin:/Users/eden/.nvm/versions/node/v6.11.2/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/eden/.rvm/bin
  9 verbose lifecycle pair@0.1.0~start: CWD: /Users/eden/Documents/GitHub/Pair./pair
  10 silly lifecycle pair@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
  11 silly lifecycle pair@0.1.0~start: Returned: code: 1  signal: null
  12 info lifecycle pair@0.1.0~start: Failed to exec start script
  13 verbose stack Error: pair@0.1.0 start: `react-scripts start`
  13 verbose stack Exit status 1
  13 verbose stack     at EventEmitter.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
  13 verbose stack     at emitTwo (events.js:106:13)
  13 verbose stack     at EventEmitter.emit (events.js:191:7)
  13 verbose stack     at ChildProcess.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
  13 verbose stack     at emitTwo (events.js:106:13)
  13 verbose stack     at ChildProcess.emit (events.js:191:7)
  13 verbose stack     at maybeClose (internal/child_process.js:891:16)
  13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  14 verbose pkgid pair@0.1.0
  15 verbose cwd /Users/eden/Documents/GitHub/Pair./pair
  16 verbose Darwin 18.2.0
  17 verbose argv "/Users/eden/.nvm/versions/node/v6.11.2/bin/node" "/usr/local/bin/npm" "run" "start"
  18 verbose node v6.11.2
  19 verbose npm  v6.4.1
  20 error code ELIFECYCLE
  21 error errno 1
  22 error pair@0.1.0 start: `react-scripts start`
  22 error Exit status 1
  23 error Failed at the pair@0.1.0 start script.
  23 error This is probably not a problem with npm. There is likely additional logging output above.
  24 verbose exit [ 1, true ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have looked at line 166 of WebpackDevServerUtils.js, and used ESLint to ID syntax errors and it couldn't find anything.</p>
  
  <p><strong>Consequently, my question is this: How do I resolve this obscure error?</strong></p>