How to find module "fs" in VS Code with TypeScript?
<p>I'm running on a MacBook Air.  I installed VS Code as an IDE and also have TypeScript installed.</p>
<p>I have a simple file with just this line:</p>
<pre><code>import fs = require('fs');
</code></pre>
<p>I'm getting a red squiggly under the 'fs' inside the parenthesis and the error message is <code>[ts] Cannot find module 'fs'.</code> The file has a .ts extension. I'm new to JavaScript and to TypeScript, but I was under the impression that <code>fs</code> was a core module, so how could it not be found?  How do I fix the problem?</p>
<p>Other things that I tried already:</p>
<ul>
<li>Putting a simple function body in the file and then compiling on the command line with <code>tsc</code>.  I get an essentially equivalent error there: <code>error TS2307: Cannot find module 'fs'.</code></li>
<li>On the command line <code>sudo npm install fs -g</code>.  This reports apparent success, but doesn't fix the problem.</li>
</ul>
<p>I poked around SE and the web, but the answers that seemed close all appear to assume that 'fs' is available.</p>