Hier ist mein vollständiger Fehler:
Error: Cannot find module 'ejs'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
at require (module.js:346:19)
at View.templateEngine (/Users/shamoon/local/node/lib/node_modules/express/lib/view/view.js:133:38)
at Function.compile (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:65:17)
at ServerResponse._render (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:414:18)
at ServerResponse.render (/Users/shamoon/local/node/lib/node_modules/express/lib/view.js:315:17)
at /Users/shamoon/Sites/soldhere.in/app.js:26:7
at callbacks (/Users/shamoon/local/node/lib/node_modules/express/lib/router/index.js:272:11)
at param (/Users/shamoon/local/node/lib/node_modules/express/lib/router/index.js:246:11)
Mein Quellcode ist auch sehr einfach:
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
app.configure(function(){
app.use(express.bodyParser());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
app.set('view engine', 'ejs');
app.set('view options', {
layout: false
});
app.get('/', function(req, res) {
res.render('index', {
message : 'De groeten'
});
});
app.listen(3000);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
In meinem Ordner habe ich ejs in node_modules installiert, die ich verwendet habe npm install ejs
.
also meine frage ist .. was gibt? Was mache ich falsch, damit der Knoten EJS nicht findet, wenn ich es eindeutig installiert habe?
Vielen Dank