Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6545691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:37:00+00:00 2026-05-25T11:37:00+00:00

I installed jade (npm install jade) and went over to their github page to

  • 0

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 title = "Things"
h1= title
ul#users
  - each user, name in users
    - if (user.isA == "ferret")
      li(class: 'user-' + name) #{name} is just a ferret
    - else
      li(class: 'user-' + name) #{name} #{user.email}

code.js:

var jade = require('jade');

var options = {
    locals: {
        users: {
            tj: { age: 23, email: 'tj@vision-media.ca', isA: 'human' },
            tobi: { age: 1, email: 'tobi@is-amazing.com', isA: 'ferret' }
        }
    }
};

console.log(jade)

jade.renderFile('code.jade', options, function(err, html){
    if (err) throw err;
    console.log(html);
});

I saved those files in their own folder, cd’d my way there and executed “node code.js”. However, node throws an error and says that Jade has no method “renderFile”! Can you tell me what am I doing wrong and what should I do to fix it?

full error message:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
TypeError: Object #<Object> has no method 'renderFile'
    at Object.<anonymous> (/home/yann/javascript/jade/code.js:18:6)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
    at EventEmitter._tickCallback (node.js:126:26)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:37:01+00:00Added an answer on May 25, 2026 at 11:37 am

    It looks like newer versions of Jade use a different API, there is no more ‘renderFile’ method. Take a look at the ‘Public API’ section on here: https://github.com/visionmedia/jade

    Something like this is probably what you want. Just remember you only need to read the file once. If you are doing it dynamically, be sure not to read it synchronously.

    var jade = require('jade');
    var fs = require('fs');
    
    var jadetemplate = jade.compile(fs.readFileSync('code.jade', 'utf8'));
    
    var html = jadetemplate({
      users: {
        tj: { age: 23, email: 'tj@vision-media.ca', isA: 'human' },
        tobi: { age: 1, email: 'tobi@is-amazing.com', isA: 'ferret' }
      }
    });
    
    console.log(html);
    

    Update

    This answer was valid when it was written, however renderFile was added back in several months later in 92c314, so it may be used now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Installed Visual Studio Web Developer 2010 Express from the ISO available from this page:
I installed integrity app these days. and found some issues. I follow this. $
I installed ActiveReports from their site. The version was labeled as .NET 2.0 build
I installed iplots and rjava packages. When I do this library(iplots), I get the
I installed the latest stable xampp package, and received the following error page when
Installed SlikSvn on Window 2008 server Created Repository at c:\dia\svn\repos running this windows service
I installed FFMPEG using apt-get. It comes by default compiled with some options: configuration:
Installed rvm gem installed passenger when I try to install passenger-install-apache2-module it gives? root@c2h2crawler:~#
I installed GitHub on mac but I don't have installed git on terminal. When
I installed a new Windows Phone 7 template this week in Visual Studio, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.