I\'m just trying to read a file using fs.readFileSync, though it seems it cannot be found.
I made sure to declare it, added it within my constructor:
Using node -v 10.15.0 and @types/node:
It seems declaration has been rewritten...
fs definition is declared as a module so you should do:
import fs from "fs"; // Without star
compiled:
var fs_1 = __importDefault(require("fs"));
or
const fs = require("fs"); instead of require("fs").default;
with star you will have fs.default.TheFunctionYouWant instead of fs.TheFunctionYouWant
The better way is to console.log(fs); to see what it is imported.
{
"compilerOptions": {
"typeRoots": [],
"types": [
"node"
]
}
}