I set the TS and node tables globally:
PS C:\Projects\Test> npm list --global --depth=0
C:\Users\Jan\AppData\Roaming\npm
+-- @types/node@7.0.5
+-- tslint@4.4.2
`-- typescript@2.2.1
Then I created the test.ts file
import fs = require("fs");
let text = fs.readFileSync("myFile.txt");
console.log(text);
Running tsc results in
PS C:\Projects\Test> tsc .\test.ts
test.ts(1,21): error TS2307: Cannot find module 'fs'.
Skip something obvious?
Thank!
source
share