Reputation: 703
Im following the tutorial here. I when trying to run the project at this point. I get an error saying that there is no defined templating engine. The tutorial has us remove the app.use
Below is my console error when trying to go through the tutorial. Just to be sure I went back through it three times. I get the same error. I notice in the History.md that this was addressed but I cant figure out what if anything i am supposed to do with that info. Can you advise?
This is the tutorial: https://azure.microsoft.com/en-us/documentation/articles/documentdb-nodejs-application/
I get the error on trying to run npm start to see the todo UI. When I run start at the beginning of the tutorial, it works.
Thank you.
Kaona (master *) todo $ npm start
> [email protected] start /Users/Kaona/GitHub/todo
> node ./bin/www
/Users/Kaona/GitHub/todo/node_modules/express/lib/view.js:62
throw new Error('No default engine was specified and no extension was provided.');
^
Error: No default engine was specified and no extension was provided.
at new View (/Users/Kaona/GitHub/todo/node_modules/express/lib/view.js:62:11)
at EventEmitter.render (/Users/Kaona/GitHub/todo/node_modules/express/lib/application.js:569:12)
at ServerResponse.render (/Users/Kaona/GitHub/todo/node_modules/express/lib/response.js:961:7)
at /Users/Kaona/GitHub/todo/routes/tasklist.js:27:17
at /Users/Kaona/GitHub/todo/models/taskDao.js:43:17
at Base.defineClass._toArrayImplementation (/Users/Kaona/GitHub/todo/node_modules/documentdb/lib/queryIterator.js:187:17)
at /Users/Kaona/GitHub/todo/node_modules/documentdb/lib/queryIterator.js:183:26
at /Users/Kaona/GitHub/todo/node_modules/documentdb/lib/queryIterator.js:234:17
at successCallback (/Users/Kaona/GitHub/todo/node_modules/documentdb/lib/documentclient.js:2069:17)
at IncomingMessage.<anonymous> (/Users/Kaona/GitHub/todo/node_modules/documentdb/lib/request.js:84:13)
Upvotes: 0
Views: 151
Reputation: 703
Per @ryancrawcour @larrymaccherone's direction. The solution is to add app.set('view engine', 'jade'); to the app.js file in the tutorial. See Error: No default engine was specified and no extension was provided
Upvotes: 1
Reputation: 24138
According to the error, I guess your machine is a Mac, but I think my steps below on linux that's similar with yours on MacOS.
The tutorial sample shows a local node app created by express generator for using Azure DocumentDB.
So the first step is creating an Azure DocumentDB instance on Azure new portal. I think it's simple, and copy the connection information of the DocumentDB created for the express app.
To create a express app like the tutorial doing, I did the steps below.
npm install express-generator -g
On MacOS, may need to add the prefix cmd
sudo
because it's for global env, see http://expressjs.com/en/starter/generator.html).
express todo
Generate a empty express app via express generator
cd todo && npm install
installation for dependent libraries registed in the
package.json
npm start
in the dir todo
and browse the url http://localhost:3000
git clone https://github.com/Azure-Samples/documentdb-node-todo-app.git
from Github project https://github.com/Azure-Samples/documentdb-node-todo-app and copy the files of the path src
of git repo to the dir todo
.config.js
with the connection information of your DocumentDB.Hope it helps. Best Regards.
Upvotes: 0