Why am I getting 'bodyParser' is deprecated warning?



I used the latest version of both packages but still, I am getting ‘bodyParser’ is a deprecated warning. It is not affecting my code but why is this happening?

const express =  require("express")
const bodyParser =  require("body-parser")

let app = express();
app.use(bodyParser.urlencoded({ extended: true }));

app.listen(port, () => {
    console.log(`Welcome to ${port}`);


It means that body-parser want you to use a different method (.json() or .urlencoded()):


Answered By – Allan Wind

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More