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
The real solution, you need to pass an absolute path as the 1st parameter in the renderFile function. It has to be relative to the root. "code.jade" won't work. Here is a working example:
jade.renderFile('/Users/tom/documents/xueqiu/pp-fe/views/a-share.jade', {name:'Shenxin Xu'}, function(err, html){
console.log(1111 + ' ' + html);
});