title: SyntaxError: Cannot use import statement outside a module in my js file
body: <p>I am just learning ES6 and I am following a free online course. In the course we are covering Promises, so I have:</p>
  
  <pre><code>import fetch from 'cross-fetch';
  
  const apiUrl = 'https://fcctop100.herokuapp.com/api/fccusers/top/alltime';
  
  function getTop100Campers(){
      fetch(apiUrl)
      .then((r) =&gt; r.json())
      .then((json) =&gt; {
          console.log(json[0])
      }).catch((error) =&gt; {
          console.log('failed');
      });
  }
  
  getTop100Campers();
  </code></pre>
  
  <p>When I run my code (I am using Visual Studio Code) I get:</p>
  
  <pre><code>C:\Program Files\nodejs\node.exe src\ES6-Course.js
  c:\Users\j\Documents\Programming\ES6\es6course\src\ES6-Course.js:1
  import fetch from 'cross-fetch';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Module._compile (internal/modules/cjs/loader.js:892:18)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
      at Module.load (internal/modules/cjs/loader.js:812:32)
      at Function.Module._load (internal/modules/cjs/loader.js:724:14)
      at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
      at internal/main/run_main_module.js:17:11
  </code></pre>
  
  <p>Am I missing something? I looked into the error on Google, so I installed cross-fetch, and I also ran npm create-react-app es6course because I thought I needed React running for this to work and I am still getting the same error message.</p>