title: Running JavaScript on Ubuntu terminal gives no output
body: <p>I am trying to execute a javascript function on a cloud ubuntu machine. Here's the code:<br></p>
  
  <pre><code>exports.msg = function(){
      console.log('This is a test function');
  }
  </code></pre>
  
  <p><br>
  Now whenever I run this using nodejs on Windows using the command <code>node test.js</code> assuming the filename is <code>test.js</code> it works perfectly<strike> and prints the output</strike>. But whenever I install nodejs (Version 4.x) on Ubuntu and try running <code>nodejs test.js</code> the console runs with no output what so ever. No errors, no output, no nothing.<br>
  Originally I am referring to <a href="https://docs.npmjs.com/getting-started/creating-node-modules" rel="nofollow noreferrer">this link</a> to do this.<br>
  I referred to <a href="https://stackoverflow.com/questions/8532960/how-do-you-run-javascript-script-through-the-terminal">this question</a> but I don't want to use Rhino. I want to use Nodejs. What am I doing wrong.<br>
  P.S. I know that nodejs runs using <code>nodejs</code> on Ubuntu and using <code>node</code> on Windows so this is definitely not the problem. Plus if you try running <code>node test.js</code> on Ubuntu without diverting the path of the executable from nodejs it will give an error.<br>
  I really don't know what I am missing here. Does nodejs has some log file in Ubuntu that I should check for the output? I tried checking the system log files with no luck.<br>
  Thanks.</p>