Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated usage of bodyParser() and npm Invalid warning #670

Open
stevenay opened this issue Aug 2, 2015 · 0 comments
Open

Deprecated usage of bodyParser() and npm Invalid warning #670

stevenay opened this issue Aug 2, 2015 · 0 comments
Assignees
Labels

Comments

@stevenay
Copy link

stevenay commented Aug 2, 2015

In Exercise 2 - Book Library application, the usage of bodyParser() constructor in server.js has been deprecated as of 2014-06-19.

app.use(bodyParser()); // deprecated

Instead of this line, it needs to be used as the following code:

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

app.use(bodyParser.json());

In addition, when installing the npm packages, body-parser dependency is listed as "~1.9.1" in the package.json file. It will cause the npm ERR! invalid: [email protected] warning when you listed your installed npm packages by the command of npm list.

(Personally, I solved this warning by npm update command.)

So instead of "~1.9.1", it should be listed as "~1.13.3" (as the time of this issue writing, the latest body-parser is "1.13.3").

Thanks.

@addyosmani addyosmani self-assigned this Aug 16, 2015
@addyosmani addyosmani added the bug label Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants