我在旧的快速二进制安装上成功运行了这行代码,但现在在AWS上设置ELB时,该行失败并出现以下错误。我正在运行以下版本的软件包。这是在生产中运行的代码并且没有改变,因此我知道它不是代码。我正在制作的快递版本是从2015年开始。我收到此错误的版本低于(即2016年末)。
PACKAGES:
"dependencies": {
"ejs": "^2.5.7",
"aws-sdk": "<=2.149.0",
"express": "<=4.14.0",
"forever": "<=0.15.3",
"socket.io-client": "<=1.5.1",
"kue": "<=0.11.5",
"body-parser": "^1.18.2"
}
ERROR:
TypeError: express.basicAuth is not a function
at Object.<anonymous> (/var/app/current/server.js:1160:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:383:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:496:3
/var/app/current/server.js:1160
app.use(express.basicAuth('user', '5a9d232349459459479'));
CODE:
// start the UI
var app = express();
app.use(express.basicAuth('user', '8a4444444444479')); <-- error