Estou tentando fazer minha aplicação a minutos, sinceramente estou quase desistindo de Node.js. Nao consigo achar nenhuma anomalia que cause o problema
Possuo o diretório: views/home.pug
Minhas dependências:
"dependencies": {
"express": "^4.15.2",
"jade": "^1.11.0",
"pug": "^2.0.0-beta11"
}
//Meu código:
var express = require('express');
var app = express();
app.set('view engine', 'pug');
app.get('/', function (rq, rp) {
rp.render("views/home");
});
app.listen(80, function () {
console.log('OK');
});
Erro:
Error: Failed to lookup view "views/home" in views directory "C:\Program Files (x86)\Ampps\www\node-study\views"
at EventEmitter.render (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\application.js:580:17)
at ServerResponse.render (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\response.js:966:7)
at C:\Program Files (x86)\Ampps\www\node-study\nodeServer.js:7:7
at Layer.handle [as handle_request] (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\layer.js:95:5)
at C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\index.js:335:12)
at next (C:\Program Files (x86)\Ampps\www\node-study\node_modules\express\lib\router\index.js:275:10)