addyosmani / addyosmani/backbone-fundamentals
Deprecated usage of bodyParser() and npm Invalid warning
- Langage dominant
- Rich Text Format
- Étoiles
- 9.2k
- Forks
- 1.4k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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: body-parser@1.9.3** 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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.