Sunday, 9 April 2017

trying to include mongodb in my application but facing error

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

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

I am attaching the error code below: at EventEmitter.render (C:\Users\jump\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\jump\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 texi rv

No comments:

Post a Comment