Error using Express for NodeJS: the "engine" of object # <View> is not a function
I am new to nodejs and was wondering if anyone knows how to debug this error:
TypeError: Property 'engine' of object #<View> is not a function I just installed the express instance after a little work, getting node / npm in the ubuntu window. Any ideas? Here is my stack trace:
500 TypeError: Property 'engine' of object #<View> is not a function at View.render (/var/www/node_modules/express/lib/view.js:75:8) at Function.app.render (/var/www/node_modules/express/lib/application.js:504:10) at ServerResponse.res.render (/var/www/node_modules/express/lib/response.js:676:7) at exports.index (/var/www/routes/index.js:7:7) at callbacks (/var/www/node_modules/express/lib/router/index.js:165:11) at param (/var/www/node_modules/express/lib/router/index.js:139:11) at pass (/var/www/node_modules/express/lib/router/index.js:146:5) at Router._dispatch (/var/www/node_modules/express/lib/router/index.js:173:5) at Object.router (/var/www/node_modules/express/lib/router/index.js:33:10) at next (/var/www/node_modules/express/node_modules/connect/lib/proto.js:190:15) Here are the routes /index.js 7: 7:
res.render('index', { title: 'Express' }); +4
1 answer
I understood. The problem is that I did not have the dependencies installed properly. It worked after executing this command:
cd . && sudo npm install My commands before this, to make the application work, referred to the first part of this tutorial:
http://shapeshed.com/creating-a-basic-site-with-node-and-express/
Thanks for the help!
0