title: Why does the call to node.js body-parser fail despite the fact that I have installed it?
body: <p>I'm beginning to learn node.js and trying to work out how to get the contents of a POST request. I am trying to follow the instructions <a href="https://stackoverflow.com/questions/5710358/how-to-get-post-a-query-in-express-js-node-js">in this post</a>. 
  So far I have successfully installed node.js (on Windows 7) and express, and been able to get my very first script to work. However my problem comes when I try to use body-parser. I have installed it and it appears to be there <a href="https://i.stack.imgur.com/O0L4C.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/O0L4C.jpg" alt="(here is a screenshot)"></a></p>
  
  <p>Here is the code of the node.js script</p>
  
  <pre><code>var express = require('express');
  var bodyParser = require('body-parser');
  var app = express();
  app.use( bodyParser.json() );       // to support JSON-encoded bodies
  app.use(express.json());       // to support JSON-encoded bodies
  
  app.get('/', function(req, res) {
      res.setHeader('Content-Type', 'text/plain');
      res.end('Vous êtes à l\'accueil');
  });
  
  app.get('/user/:usernum', function(req, res) {
      res.setHeader('Content-Type', 'text/plain');
      res.end('You are on page USER with n° : ' + req.params.usernum);
  });
  
  // https://stackoverflow.com/questions/5710358/how-to-get-post-a-query-in-express-js-node-js
  app.post('/adonis', function(req, res) {
      res.setHeader('Content-Type', 'text/plain');
      console.log(req.body.title);
  //    res.write(JSON.stringify(req));
      res.end('Hopefully I stringified a POST');
  });
  
  // ... Tout le code de gestion des routes (app.get) se trouve au-dessus
  
  app.use(function(req, res, next){
      res.setHeader('Content-Type', 'text/plain');
      res.status(404).send('Page introuvable !');
  });
  
  app.listen(8091);
  </code></pre>
  
  <p>Yet when I run it, node.js throws an error saying "cannot find module body-parser". What have I done wrong?</p>
  
  <p>As per @Kale's and others' suggestions I tried installing body-parser locally, but this does not seem to help since now my script gives the following message:</p>
  
  <pre><code>Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
  at Function.Object.defineProperty.get (d:\smartguide\nodejs\node_modules\express\lib\express.js:99:13)
  at Object.&lt;anonymous&gt; (d:\smartguide\nodejs\oc1.js:5:16)
  at Module._compile (module.js:460:26)
  at Object.Module._extensions..js (module.js:478:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Function.Module.runMain (module.js:501:10)
  at startup (node.js:129:16)
  at node.js:814:3`
  </code></pre>
  
  <p>I tried installing "json" locally and globally - the install seems to work but it makes no difference to the file error.</p>