title: How can I import node module into svelte component
body: <p>I'm new to svelte and I am trying to use an installed node module in my dependancies called momentum-slider. In the script tags of my svelte component I have:</p>
  <pre><code>import MomentumSlider from &quot;../../node_modules/momentum-slider&quot;;
  let slider = new MomentumSlider({
     el: &quot;.ms-container&quot;,
  });
  </code></pre>
  <p>In my component's html markup I have the suggested markup as shown in the tutorial at <a href="https://scotch.io/tutorials/building-a-fancy-countdown-timer-with-momentumsliderjs" rel="nofollow noreferrer">https://scotch.io/tutorials/building-a-fancy-countdown-timer-with-momentumsliderjs</a></p>
  <p>However, I am getting a typeError in the browser console:</p>
  <p><a href="https://i.stack.imgur.com/shE4x.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/shE4x.gif" alt="enter image description here" /></a></p>
  <p>I am new to development in general and I am not sure if this is a problem with momentum-slider or an error on my part. Any insights would be much appreciated.</p>