title: How to use node module? SyntaxError: import declarations may only appear at top level of a module
body: <p>I'm trying to use fetch-jsonp, so I type npm i fetch-jsonp to download it and its in my package.json dependencies. Then I try to import it using:</p>
  
  <pre><code>import fetchJsonp from 'fetch-jsonp'; 
  </code></pre>
  
  <p>at the top of my main.js but it keep getting this error: </p>
  
  <p>SyntaxError: import declarations may only appear at top level of a module</p>
  
  <p>What is causing this? My file structure is:</p>
  
  <p>JS -> main.js</p>
  
  <p>node_modules -> fetch-jsonp</p>
  
  <p>.gitignore</p>
  
  <p>index.html</p>
  
  <p>package.json</p>