windows下nodejs常见错误

时间:2021-03-27 19:43:17

1.express-session

express-session deprecated undefined resave option; provide resave option auth_s
erver.js:16:9
express-session deprecated undefined saveUninitialized option; provide saveUnini
tialized option auth_server.js:16:9

解决:

app.use(session({
secret: cookie_secret,
resave: true,
saveUninitialized: true
}));

2.body-parse

body-parse deprecated undefined resave option; provide resave option auth_s
erver.js:16:9

解决:

app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());