1

我想知道使用 .jade 调用文件时是否需要 .jade res.render('login', { locals: { title: 'Hello - Please Login To Your Account' }});。假设 login.jade 存在。我还想知道是否可以用它创建一个 html5。我是否必须像 res.render('login.html') 那样调用它?所以在安装 html 模块后,我在登录页面中得到了以下信息:

TypeError: Object #<Object> has no method 'compile'
    at Function.compile (/var/www/node-login/node_modules/express/lib/view.js:68:33)
    at ServerResponse._render (/var/www/node-login/node_modules/express/lib/view.js:417:18)
    at ServerResponse.render (/var/www/node-login/node_modules/express/lib/view.js:318:17)
    at /var/www/node-login/app/server/router.js:49:8
    at callbacks (/var/www/node-login/node_modules/express/lib/router/index.js:272:11)
    at param (/var/www/node-login/node_modules/express/lib/router/index.js:246:11)
    at pass (/var/www/node-login/node_modules/express/lib/router/index.js:253:5)
    at Router._dispatch (/var/www/node-login/node_modules/express/lib/router/index.js:280:5)
    at Object.handle (/var/www/node-login/node_modules/express/lib/router/index.js:45:10)
    at next (/var/www/node-login/node_modules/express/node_modules/connect/lib/http.js:204:15)
4

0 回答 0