Node: TypeError: Cannot read property 'on' of undefined
<p>I'm trying to parse a JSON file using Node JS, but the file doesn't seem to be read properly. I keep getting this error:</p>

<pre><code>request.on("error", function(error){
       ^

TypeError: Cannot read property 'on' of undefined
    at Object.&lt;anonymous&gt; (/Users/jaeeunlee/Downloads/takehome_test-master/prediction.js:31:8)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
</code></pre>

<p>My Node JS file:</p>

<pre><code>var fs = require("fs");

var request = fs.readFile("blog_data.json", 'utf8', function(response){
   var body = "";
   console.log(response.statusCode);
   response.on("data", function(chunk) {
        body += chunk;
   });
   response.on("end", function(){
        // var profile = JSON.parse(body);
        // console.dir(profile);
   })
});


request.on("error", function(error){
    console.error(error.message);
})
</code></pre>