Node.js Leaflet error
<p>Please help!! I know I'm missing something very simple but I'm new to all this and I read lots of different post and tutorial and can't get whats wrong.</p>

<p>I initiate a new project on Ubuntu 14.04
Navigate to the folder I want my app to be.</p>

<p>This is the steps I take:</p>

<pre><code>sudo apt-get install nodejs-legacy
sudo npm install express-generator -g  (framework)

express -e --ejs (Establece el lenguaje ejs como base) 
https://www.npmjs.com/package/ejs
npm install
</code></pre>

<p>To run the app <code>DEBUG=myapp:* npm start</code></p>

<p>Then load <a href="http://localhost:3000/" rel="nofollow">http://localhost:3000/</a> in your browser to access the app.<br></p>

<pre><code>npm install --save leaflet
npm install --save leaflet-draw
</code></pre>

<p>To here everything works ok!</p>

<p>In app.js I add this single line:</p>

<pre><code>var L = require('leaflet');
</code></pre>

<p>and get the ugly error I pasted</p>

<pre><code>/home/diego/Escritorio/fundacion/node_modules/leaflet/dist/leaflet-src.js:9168
}(window, document));
  ^
ReferenceError: window is not defined
    at Object.&lt;anonymous&gt; (/home/diego/Escritorio/fundacion/node_modules/leaflet/dist/leaflet-src.js:9168:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.&lt;anonymous&gt; (/home/diego/Escritorio/fundacion/app.js:10:9)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
</code></pre>