title: node.js - ReferenceError: navigator is not defined
body: <p>I'm getting <strong>ReferenceError: navigator is not defined</strong> running the following code on node.js:</p>
  
  <pre><code>navigator.geolocation.getCurrentPosition((data) =&gt; {
    console.log(data);
  });
  </code></pre>
  
  <p>I assume that the problem is that <strong><em>Navigator.geolocation</em></strong> is a Web API and doesn't work on node. Is there a way to mock the browser and use it on node.js?</p>
  
  <p>Many thanks</p>