Saturday, 8 April 2017

Error while opening the web page

I have been trying to open the web page from the server in command prompt by following the youtube tutorial. But I am getting the following error page in the attempt of opening the web page which has been attached below. Kindly help me out of this. can you guys assist me where the issue is coming. youtube link: https://www.youtube.com/watchv=hE5zeEiVqpw&list=PL55RiY5tL51oGJorjEgl6NVeDbx_fO5jR&index=13

Error: Failed to lookup view "error" in views directory

"C:\Users\Atchaya\web\first-1\views"
    at EventEmitter.render (C:\Users\Atchaya\web\first-1\node_modules\express\lib\application.js:580:17)
    at ServerResponse.render (C:\Users\Atchaya\web\first-1\node_modules\express\lib\response.js:966:7)
    at C:\Users\Atchaya\web\first-1\app.js:49:7
    at Layer.handle_error (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\layer.js:71:5)
    at trim_prefix (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:315:13)
    at C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:275:10)
    at Layer.handle_error (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\layer.js:67:12)
    at trim_prefix (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:315:13)
    at C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:275:10)
    at Layer.handle_error (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\layer.js:67:12)
    at trim_prefix (C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:315:13)
    at C:\Users\Atchaya\web\first-1\node_modules\express\lib\router\index.js:284:7

I am attaching the error code below: at EventEmitter.render (C:\Users\Atchaya\web\first-1\node_modules\express\lib\application.js:580:17)

if (!view.path) {
      var dirs = Array.isArray(view.root) && view.root.length > 1
        ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"'
        : 'directory "' + view.root + '"'
      var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs);

at C:\Users\Atchaya\web\first-1\app.js:49:7

app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};

  // render the error page
  res.status(err.status || 500);
  res.render('error');
});



via youtube3

No comments:

Post a Comment