title: Failed to lookup view "index.ejs" in views directory
body: <p>I have the following code in my express app (app.js file):</p>
  
  <pre><code>const express = require("express");
  const app = express();
  
  app.set('view engine', 'ejs');
  
  app.get('/', function(req, res) {
      res.render('index');
  });
  
  app.listen(8080);
  </code></pre>
  
  <p>And the following dependencies:</p>
  
  <pre><code>"ejs": "^2.6.1",
  "express": "^4.16.3",
  "request": "^2.87.0"
  </code></pre>
  
  <p>And this is my folder structure:</p>
  
  <pre><code>myapp
     app.js
     package.json
     views
        index.ejs
     node_modules
        [all node files]
  </code></pre>
  
  <p>But when I run the app, it shows this error:</p>
  
  <pre><code>Failed to lookup view "index.ejs" in views directory "mylocaldirectory/myapp/views"
  </code></pre>
  
  <p>If it would help here are the other error messages:</p>
  
  <pre><code>  at Function.render (/mylocaldirectory/myapp/node_modules/express/lib/application.js:580:17)
      at ServerResponse.render (/mylocaldirectory/myapp/node_modules/express/lib/response.js:1008:7)
      at //mylocaldirectory/myapp/app.js:11:9
      at Layer.handle [as handle_request] (/mylocaldirectory/myapp/node_modules/express/lib/router/layer.js:95:5)
      at next (/mylocaldirectory/myapp/node_modules/express/lib/router/route.js:137:13)
      at Route.dispatch (/mylocaldirectory/myapp/node_modules/express/lib/router/route.js:112:3)
      at Layer.handle [as handle_request] (/mylocaldirectory/myapp/node_modules/express/lib/router/layer.js:95:5)
      at /mylocaldirectory/myapp/node_modules/express/lib/router/index.js:281:22
      at Function.process_params (/mylocaldirectory/myapp/node_modules/express/lib/router/index.js:335:12)
      at next (/mylocaldirectory/myapp/node_modules/express/lib/router/index.js:275:10)
  </code></pre>
  
  <p>I get no error if I just use <code>res.send("SOME TEXT")</code> but when I try to render an ejs file, it doesn't. What's the issue?</p>