Express plus multer threw an error:’ app.use () requirements middleware functions’

  node.js, question

With node, you want to pass values through the form. node’s code is as follows:

var express=require('express'),
 //form's get method uses a url module
 url=require('url'),
 //form's post method uses url modules
 bodyParser=require('body-parser'),
 multer=require('multer'),
 util=require('util'),
 app=express();
 
 app.use(multer({dest:'./'}));
 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded({extended:true}));
 
 app.get('/',function(req,res){
 res.sendfile('./index.html');
 });
 
 App.post ('/reg', function (req, res) {//page is post, server side is also to post
 var urlObj=url.parse(req.url,true);
 res.write(util.inspect(req.files));
 res.end(JSON.stringify(req.body));
 });
 
 app.listen(8080);

The current express version is 4.13.3 and multer’s version is 1.0.1

The error thrown by the run is as follows:

throw new TypeError('app.use() requires middleware functions');

A similar problem was found on stackoverflow, but his reason was the problem with the package used.Stackoverflow problem.
I looked at multer’s document as if it had not made similar changes. I specially asked you this question.

This problem and its resolution are the multer version. Multer needs version 0.1.8.

npm install multer@0.1.8