我无法使用 express.js 子模块,并且我认为我缺少与 npm 相比基本的东西。我正在尝试按照本教程构建一个简单的身份验证系统。
在应用程序目录中表达的路径:
./node_modules/express/lib/express.js
我的应用程序:
var express = require('express');
var app = express.createServer();
app.use(express.bodyDecoder()); // problems happen here
这就是发生的事情:
meeeeee$ node app.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<Object> has no method 'bodyDecoder'
at Object.<anonymous> (/Users/nflacco/Projects/santorinillc/js/auth-demo/app.js:3:17)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
也供参考,我的 package.json 文件:
{
"name" : "my dirty little app",
"version" : "0.0.1",
"dependencies" :
{
"express" : "2.5.9",
"connect" : "1.8.7",
"optimist" : "0.3.4"
}
}