node.js body-parser 为什么会报错 bodyParser.raw is not a function?
ringa_lee
ringa_lee 2017-04-17 14:36:52
0
2
803

很简单的一段代码,想要设置raw的entity大小,因为上传图片导致node request entity too large

修改:

app.use(bodyParser.json({limit: "50mb"}));
app.use(bodyParser.raw({limit: "50mb"}));//这里出错了,bodyParser.raw is not a function?
app.use(bodyParser.urlencoded({limit: "50mb", extended: true, parameterLimit:50000}));
ringa_lee
ringa_lee

ringa_lee

Antworte allen(2)
PHPzhong

你的body-parser什么版本?

Peter_Zhu

这些中间件都已经在exprss4.0之后connect中分离出来了

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage