title: ReferenceError : window is not defined at object. <anonymous> Node.js
body: <p>I've seen similar questions that were asked here but none matches my situation. In my web I have 3 <code>JavaScript</code> files : <code>client.js</code> , <code>server.js</code> ,<code>myModule.js</code> . In <code>client.js</code> I create a window variable called <code>windowVar</code> and I add to it some atrributes. In <code>myModule.js</code> ,I add some other attributes and use them there and I export the file and require it in <code>server.js</code>.</p>
  
  <p><code>client.js</code>:</p>
  
  <pre><code>window.windowVar= {
      func1: function(args) {    
         //some sode here
      },
      counter:0
  };
  </code></pre>
  
  <p><code>myModule.js</code> :</p>
  
  <pre><code>module.exports={wVar:windowVar, addMessage ,getMessages, deleteMessage};
  
  windowVar.serverCounter = 0;
  windowVar.arr1=[];
  </code></pre>
  
  <p><code>server.js</code>:</p>
  
  <pre><code>var m= require('./myModule');
  </code></pre>
  
  <p>when running the server in node.js I get the following error:</p>
  
  <blockquote>
    <p>ReferenceError : window is not defined at object. <code>&lt;anonymous&gt;</code></p>
  </blockquote>
  
  <p>As I understood window is a browser property ,but how can I solve the error in this case? Any help is appreciated </p>