title: ReferenceError: Path is not defined: EJS
body: <p>The app runs for shop and admin routes but doesn't work for error route.Error routes was also in MVC format but i tested it without the architecture also.<br>
  Below is the snippet of app.js from root directory.</p>
  
  <pre><code>const path = require('path');
  
  const express = require('express');
  const bodyParser = require('body-parser');
  
  const errorController = require('./controllers/error');
  
  const app = express();
  
  app.set('view engine', 'ejs');
  app.set('views', 'views');
  
  const adminRoutes = require('./routes/admin');
  const shopRoutes = require('./routes/shop');
  
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/admin', adminRoutes);
  app.use(shopRoutes);
  
  app.use((req, res, next) =&gt; {
    res.status(404).render('404', { pageTitle: 'Page Not Found' });
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>And the 404 EJS code is </p>
  
  <pre><code>&lt;%- include('includes/head.ejs') %&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;%- include('includes/navigation.ejs') %&gt;
      &lt;h1&gt;Page Not Found!&lt;/h1&gt;
  
  &lt;%- include('includes/end.ejs') %&gt;
  </code></pre>
  
  <p>And, Navigation.ejs is </p>
  
  <pre><code>&lt;header class="main-header"&gt;
      &lt;nav class="main-header__nav"&gt;
          &lt;ul class="main-header__item-list"&gt;
              &lt;li class="main-header__item"&gt;
                  &lt;a class="&lt;%= path === '/' ? 'active' : '' %&gt;" href="/"&gt;Shop&lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="main-header__item"&gt;
                  &lt;a class="&lt;%= path === '/admin/add-product' ? 'active' : '' %&gt;" href="/admin/add-product"&gt;Add Product&lt;/a&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>It shows the following error: </p>
  
  <pre><code>ReferenceError: C:\Users\Najus\Desktop\New folder\views\404.ejs:5
      3| 
      4| &lt;body&gt;
   &gt;&gt; 5|     &lt;%- include('includes/navigation.ejs') %&gt;
      6|     &lt;h1&gt;Page Not Found!&lt;/h1&gt;
      7| 
      8| &lt;%- include('includes/end.ejs') %&gt;
  
  C:\Users\Najus\Desktop\New folder\views\includes\navigation.ejs:6
      4|         &lt;ul class="main-header__item-list"&gt;
      5|             &lt;li class="main-header__item"&gt;
   &gt;&gt; 6|                 &lt;a class="&lt;%= path === '/' ? 'active' : '' %&gt;" href="/"&gt;Shop&lt;/a&gt;
      7|             &lt;/li&gt;
      8|             &lt;li class="main-header__item"&gt;
      9|                 &lt;a class="&lt;%= path === '/admin/add-product' ? 'active' : '' %&gt;" href="/admin/add-product"&gt;Add Product&lt;/a&gt;
  
  path is not defined
      at eval (eval at compile (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:618:12), &lt;anonymous&gt;:11:26)
      at returnedFn (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:653:17)
      at include (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:651:39)
      at eval (eval at compile (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:618:12), &lt;anonymous&gt;:12:17)
      at returnedFn (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:653:17)
      at tryHandleCache (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:251:36)
      at View.exports.renderFile [as engine] (C:\Users\Najus\Desktop\New folder\node_modules\ejs\lib\ejs.js:482:10)
      at View.render (C:\Users\Najus\Desktop\New folder\node_modules\express\lib\view.js:135:8)
      at tryRender (C:\Users\Najus\Desktop\New folder\node_modules\express\lib\application.js:640:10)
      at Function.render (C:\Users\Najus\Desktop\New folder\node_modules\express\lib\application.js:592:3)
  </code></pre>
  
  <p>I have tried back and forth various ways looking up the internet and couldn't find the way to tweak the code. </p>