Error: Failed to lookup view "index" in views directory "/views"这是什么原因啊
Error: Failed to lookup view "index" in views directory "/views"
at EventEmitter.app.render (E:\projects\Imooc\node_modules\express\lib\application.js:555:17)
at ServerResponse.res.render (E:\projects\Imooc\node_modules\express\lib\response.js:938:7)
at E:\projects\Imooc\app.js:14:6
at Layer.handle [as handle_request] (E:\projects\Imooc\node_modules\express\lib\router\layer.js:82:5)
at next (E:\projects\Imooc\node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (E:\projects\Imooc\node_modules\express\lib\router\route.js:91:3)
at Layer.handle [as handle_request] (E:\projects\Imooc\node_modules\express\lib\router\layer.js:82:5)
at E:\projects\Imooc\node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (E:\projects\Imooc\node_modules\express\lib\router\index.js:321:12)
at next (E:\projects\Imooc\node_modules\express\lib\router\index.js:261:10)
var express = require('express');
var port = process.env.PORT||3000;
var app = express();
app.set('views','/views');
app.set('view engine','jade');
app.set('port',3000);
app.listen(port,function(){
console.log('Imooc started on port '+port);
})
app.get('/',function(req,res){
res.render('index',{title:'Imooc首页'});
//res.send('Hello World')
})