title: scrollreveal ReferenceError: document is not defined after requiring const ScrollReveal = require("scrollreveal");
body: <p>I am trying to use the scrollreveal javascript. Installed it via npm and use it in my NodeJS code (see below). Also, I'm including it in my HTML as well.</p>
  <p>Now when I run nodemon app.js in hyper terminal I get this error:</p>
  <blockquote>
  <p>C:\Users\Admin\Desktop\My Projects\test\node_modules\scrollreveal\dist\scrollreveal.js:33
  container: document.documentElement,
  ^</p>
  </blockquote>
  <blockquote>
  <p>ReferenceError: document is not defined</p>
  </blockquote>
  <p>index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot; /&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;
      &lt;title&gt;Document&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello&lt;/h1&gt;
      &lt;script src=&quot;https://unpkg.com/scrollreveal@4.0.9/dist/scrollreveal.min.js&quot;&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>
  <p>app.js</p>
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const app = express();
  const ScrollReveal = require('scrollreveal');
  
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(express.static('public'));
  
  app.get('/', function (req, res) {
    res.sendFile(__dirname + '/index.html');
  });
  
  app.listen(3000, function () {
    console.log('server start on port 3000');
  });
  
  </code></pre>