You are using the same variable “err” in both outer and inner callbacks, which is prevented by tslint.
If you want to use the same variable then “no-shadowed-variable”: false, otherwise do as below.
fs.readdir(fileUrl, (readDirError, files) => {
fs.readFile(path.join(fileUrl, files[0]), function (err, data) {
if (!err) {
res.send(data);
}
});
});