title: sails js template jst.js error can't find variable _
body: <p>I'm new to programming and learning JavaScript and Sails JS. I do love it so far but ran into a problem which I don't understand. Forgive me if I'm using the wrong terminology, I have no programming background.</p>
  
  <p>I run on Sails v0.12.1 (clean install) and on OSX (if this matters)</p>
  
  <p>In /assets/templates I have created a template file called 'testTemplate.ejs'. Which only contains a h3 tag with simple text:</p>
  
  <pre><code>&lt;h3&gt;This is the template&lt;/h3&gt;
  </code></pre>
  
  <p>In my /assets/js/app.js I have a simple jQuery 'call' to inset the template in my clientside page:</p>
  
  <pre><code>$('tr:last').after(
      JST['assets/templates/testTemplate.ejs'](obj)
  );
  </code></pre>
  
  <p>So far so good. My app works fine on all views etc but trows an error when it reaches this point. The error is telling me that it can't find variable '_' which is located in /jst.js at the first __t (line 4):</p>
  
  <pre><code>this["JST"] = this["JST"] || {};
  this["JST"]["assets/templates/addUser.ejs"] = function(obj) {
      obj || (obj = {});
      var __t, __p = '', __e = _.escape;
      with (obj) {
          __p += '&lt;h3&gt;Dit is de template&lt;/h3&gt;';
      }
      return __p
  };
  </code></pre>
  
  <p>I've tried to install underscore.js with the command:</p>
  
  <pre><code>npm install underscore --save
  </code></pre>
  
  <p>But that didn't make a difference. I've also tried to use html instead of ejs for the template (changing the pipeline as well).</p>
  
  <p>I have no clue anymore why I'm getting this error:</p>
  
  <pre><code>ReferenceError: Can't find variable: _
  </code></pre>
  
  <p>or how I should/could fix it.</p>
  
  <p>Can anyone please help me?</p>