title: How do I generate an html file with ejs in command line?
body: <p>I'm learning an <a href="https://ejs.co/#install" rel="nofollow noreferrer">ejs tutorial</a>, which gives this command</p>
  <pre><code>ejs ./template_file.ejs -f data_file.json -o ./output.html
  </code></pre>
  <p>to generate an html file in command line.</p>
  <p>Here is what I did on my ubuntu 20.04 LTS.</p>
  <p>I created a directory</p>
  <pre><code>mkdir ejs-demo &amp;&amp; cd &quot;$_&quot;
  </code></pre>
  <p>I initialized a new npm project</p>
  <pre><code>npm init -y
  </code></pre>
  <p>I installed the <code>ejs</code> package:</p>
  <pre><code>npm install ejs
  </code></pre>
  <p>I created a new file named <code>template_file.ejs</code></p>
  <pre><code>nano template_file.ejs
  </code></pre>
  <p>I put the code from <a href="https://ionicabizau.github.io/ejs-playground/" rel="nofollow noreferrer">another tutorial</a> in <code>template_file.ejs</code></p>
  <pre><code>OK, so have fun! :D
  -------------------
  &lt;%
      var fruits = [&quot;Apple&quot;, &quot;Pear&quot;, &quot;Orange&quot;, &quot;Lemon&quot;]
        , random = &quot; &quot;.repeat(2).split(&quot;&quot;).map(x =&gt; Math.random())
        ;
  %&gt;
  
  These fruits are amazing:
  &lt;% for(var i = 0; i &lt; fruits.length; ++i) {%&gt;
    - &lt;%=fruits[i]%&gt;s&lt;% } %&gt;
  
  Let's see some random numbers:
  
  &lt;% random.forEach((c, i) =&gt; {
  %&gt; &lt;%=c.toFixed(10) + ((i + 1) % 6 === 0 ? &quot;\n&quot;: &quot;&quot;) %&gt;&lt;%});%&gt;
  </code></pre>
  <p>I saved and quit the editor.</p>
  <p>I tried the following command</p>
  <pre><code>ejs ./template_file.ejs -o ./output.html
  </code></pre>
  <p>and got</p>
  <blockquote>
  <p>Command 'ejs' not found, did you mean</p>
  <p>…</p>
  </blockquote>
  <p>What am I missing?</p>