title: Importing Node Modules With JavaScript
body: <p>I apologize for the simple question, but I'm pretty new to web development and JavaScript.</p>
  
  <p>I want to import a package I've installed using npm, specifically shopify-buy following the guide here: <a href="https://shopify.github.io/js-buy-sdk/" rel="noreferrer">https://shopify.github.io/js-buy-sdk/</a></p>
  
  <p>The package is in my node_modules folder and I'm trying to import it into a JavaScript document using <code>import Client from 'shopify-buy';</code></p>
  
  <p>When I try to load everything up in Chrome, I get an error on the import line</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected identifier
  </code></pre>
  
  <p>The Firefox error is a bit different: <code>import declarations may only appear at top level</code></p>
  
  <p>What am I doing wrong?</p>
  
  <p>Edit:</p>
  
  <p>The import line is the first line in my JavaScript file.  And my HTML file is properly linked to the JS file (I think).</p>
  
  <p><strong>shopify.js</strong></p>
  
  <pre><code>// Functions for SHOPIFY
  import Client from 'shopify-buy';
  
  const client = Client.buildClient({
      domain: 'xxxxx.myshopify.com',
      storefrontAccessToken: 'xxxxx'
  });
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;script src="javascript/shopify.js"&gt;&lt;/script&gt;
  </code></pre>