NodeJS Express:#<object>没有方法'parse'</object>

时间:2013-10-16 15:42:04

标签: node.js express

使用以下命令创建新包时,NodeJS.express出现问题:

express test_web

它已成功创建,但是当我打开localhost:3000主页时,它无法访问parse方法!

这是一个完整的页面:

Express
500 TypeError: /Users/user/Documents/p/hello_test/views/index.jade:5 3| block content 4| h1= title > 5| p Welcome to #{title} Object #<Object> has no method 'parse'
at detect (/Users/user/Documents/p/hello_test/node_modules/jade/node_modules/with/index.js:33:22)
at addWith (/Users/user/Documents/p/hello_test/node_modules/jade/node_modules/with/index.js:8:28)
at parse (/Users/user/Documents/p/hello_test/node_modules/jade/lib/jade.js:105:11)
at Object.exports.compile (/Users/user/Documents/p/hello_test/node_modules/jade/lib/jade.js:142:9)
at Object.exports.render (/Users/user/Documents/p/hello_test/node_modules/jade/lib/jade.js:196:15)
at Object.exports.renderFile (/Users/user/Documents/p/hello_test/node_modules/jade/lib/jade.js:233:18)
at View.exports.renderFile [as engine] (/Users/user/Documents/p/hello_test/node_modules/jade/lib/jade.js:218:21)
at View.render (/Users/user/Documents/p/hello_test/node_modules/express/lib/view.js:76:8)
at Function.app.render (/Users/user/Documents/p/hello_test/node_modules/express/lib/application.js:506:10)
at ServerResponse.res.render (/Users/user/Documents/p/hello_test/node_modules/express/lib/response.js:803:7)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

安装此版本http://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz,错误就会消失。