Body-parser deprecated?

Doing the Boss Machine cumulative project which requires body-parser(by name; am not looking for some workaround).

VSCode crosses it out the var I have it saved to and tells me it’s deprecated. Googling the problem only shows me StackOv threads from seven years ago about it being deprecated as middleware, but I had no issue using it all through the lessons leading up to this and have found other threads on the forums here showing people using it this year with no deprecation warnings. It’s installed properly in my package.json filed, v. 1.17.2.

Not sure where to go next.

You can see the alternative here: Express JS— body-parser and why may not need it | by Michael Majdanski | Medium

Basically, it’s marked as deprecated because Express now contains its own body-parser, which is directly based on the old external tool. So it is just redundant. It should still work fine because the code for the new and old ways is essentially the same. Others may have turned off the warning because it was getting annoying. The tests for the project haven’t been updated in a long time, so you may need to use the old way to pass the project.

1 Like