Callback must be a function. Received 'utf-8'

technical talkiess
0

 Error :- 


Last 1 Keys:

 UpArrow


Exception:

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.

Parameter name: top

Actual value was -1.

  


TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received 'utf-8'

    



Asyuncronous me apne fallback nahi likha hai …


Error Code :- var fs = require('fs');


fs.readFile("test.txt",'utf-8');


console.log("Testing is done");



Solved Code:- 

var fs = require('fs');


fs.readFile("test.txt",'utf-8',(err,data)=>{

  console.log(data)

});


console.log("Testing is done");


Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)