LearnBoost/socket.io — Issue #641: events.js:48 throw arguments[1]; // Unhandled 'error' event
Author: vmrathod
Created: 2011-11-14 13:25:31+00:00
State: open

I have written below code in streamreader.js file.

var fs = require("fs");
var readStream;

try
{
readStream=fs.createReadStream("hello.txt");
readStream.on('data',function(data){
console.log(data);
});
readStream.on('end',function(){
console.load('file ended');
});
}
catch(err)
{
readStream.on('error',function()
{
console.log(err);
});
}

but when i try to run this file using >node streamreader.js
I am getting below error.

events.js:48
throw arguments[1]; // Unhandled 'error' even
^
Error: ENOENT, The operation completed successfully.
'hello.txt'

Can you help me to resolve this issue?