Error: No default engine was specified and no extension was provided (ExpressJs & nunjucks)Error: No default engine was specified and no extension was providedError: No default engine was specified and no extension was provided. at new View — node-push serverHow to set marko template engine in expressjs 4.0Unable to load css fileExpressJS + Express-mailer No default enginejsonwebtoken error No default engine was specified and no extension was providedExpress - Error: No default engine was specified and no extension was providedNode Express RESTful API default engine for error handlingReact - express: No default engine was specified and no extension was provided

Aligning object in a commutative diagram

What can plausibly explain many of my very long and low-tech bridges?

Through what methods and mechanisms can a multi-material FDM printer operate?

Is there any word or phrase for negative bearing?

Completing the square to find if quadratic form is positive definite.

How can drunken, homicidal elves successfully conduct a wild hunt?

How is it possible that Gollum speaks Westron?

You've spoiled/damaged the card

Secure offsite backup, even in the case of hacker root access

Importance sampling estimation of power function

What is in `tex.print` or `tex.sprint`?

Did thousands of women die every year due to illegal abortions before Roe v. Wade?

Whats the next step after commercial fusion reactors?

From system of coupled ODEs to separable ODE

Finding x,y coordinates where y is largest

Can a 2nd-level sorcerer use sorcery points to create a 2nd-level spell slot?

PC video game involving floating islands doing aerial combat

Is it legal in the UK for politicians to lie to the public for political gain?

What happens to foam insulation board after you pour concrete slab?

Can a magnetic field of an object be stronger than its gravity?

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP)/sleep apnea device?

How to supress loops in a digraph?

How bad would a partial hash leak be, realistically?

Do any instruments not produce overtones?



Error: No default engine was specified and no extension was provided (ExpressJs & nunjucks)


Error: No default engine was specified and no extension was providedError: No default engine was specified and no extension was provided. at new View — node-push serverHow to set marko template engine in expressjs 4.0Unable to load css fileExpressJS + Express-mailer No default enginejsonwebtoken error No default engine was specified and no extension was providedExpress - Error: No default engine was specified and no extension was providedNode Express RESTful API default engine for error handlingReact - express: No default engine was specified and no extension was provided






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
























  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59

















1















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
























  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59













1












1








1








I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.










share|improve this question
















I am trying to use nunjucks templating engine with Expres js. The page is rendered correctly but error appears on console.
Error: No default engine was specified and no extension was provided.



from nunjucks docs



var app = express();

nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index.html');
);


I traced the error and found it comes form at new NunjucksView (C:UsersfutureDesktopNew folder (2)node_modulesnunjuckssrcexpress-app.js:13:13)



In nodemodules/nunjucks/src/express-app.js throw error



 if (!this.ext && !this.defaultEngine) 
throw new Error('No default engine was specified and no extension was provided.');



Which means as I understand that defaultEngine is not set.



Github Repo




How to set default template engine while using nunjucks.







node.js express nunjucks






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 18:29







Elhaw

















asked Mar 24 at 14:42









ElhawElhaw

9012




9012












  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59

















  • mozilla.github.io/nunjucks/api.html#express ?

    – Aikon Mogwai
    Mar 25 at 8:59
















mozilla.github.io/nunjucks/api.html#express ?

– Aikon Mogwai
Mar 25 at 8:59





mozilla.github.io/nunjucks/api.html#express ?

– Aikon Mogwai
Mar 25 at 8:59












1 Answer
1






active

oldest

votes


















1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324940%2ferror-no-default-engine-was-specified-and-no-extension-was-provided-expressjs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48
















1














You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer























  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48














1












1








1







You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj






share|improve this answer













You should set the default view engine for express to be the same extension known/rendered by nunjucks



const express = require('express');
const nunjucks = require('nunjucks');

const app = express();

// set default express engine and extension
app.engine('html', nunjucks.render);
app.set('view engine', 'html');

// configure nunjucks engine
nunjucks.configure('views',
autoescape: true,
express: app
);

app.get('/', function(req, res)
res.render('index');
);

app.listen(9090, () =>
console.log('http://localhost:9090')
);


if you want to change templates/views extension, you can change it like that:



app.engine('nunj', nunjucks.render);
app.set('view engine', 'nunj');


and then rename your templates/views index.nunj







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 12:44









Ahmed AyoubAhmed Ayoub

17117




17117












  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48


















  • It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

    – Elhaw
    Mar 26 at 13:48

















It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

– Elhaw
Mar 26 at 13:48






It works. But it throw Error: template not found: error.html. I added error.html file in view directory and error is fixed.@Ahmed Ayoub I did not try changing templates/views extension.

– Elhaw
Mar 26 at 13:48




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324940%2ferror-no-default-engine-was-specified-and-no-extension-was-provided-expressjs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript