I installed jade (npm install jade) and went over to their github page to grab some examples. This is what I wanted to execute:
code.jade:
- var titl
I recently came across the same issue. In the Alex Young tutorial I was following he was using jade.renderFile(). Similar to your case I was getting the same method not found message. After searching around I found that he had updated the function in a later commit. In this case he had created a custom function (renderJadeFile) as a "drop in" replacement for the jade.renderFile() function (See following code snippet).
Hope this helps others looking for a solution to this problem.
// Replacement function for jade.renderFile.
function renderJadeFile(template, options) {
var fn = jade.compile(template, options);
return fn(options.locals);
}
emails = {
send: function(template, mailOptions, templateOptions) {
mailOptions.to = mailOptions.to;
// jade.renderFile(path.join(__dirname, 'views', 'mailer', template), templateOptions, function(err, text) {
renderJadeFile(path.join(__dirname, 'views', 'mailer', template), templateOptions, function(err, text) {
// Add the rendered Jade template to the mailOptions
mailOptions.body = text;
// CODE SHORTENED FOR BREVETIY
},
sendWelcome: function(user) {
this.send('welcome.jade', {
to: user.email,
subject: 'Welcome to Nodepad'
},
{ locals: {
user: user
}
});
}
};