title: How to connect to a sqlite db from a React app?
body: <p>I'm trying to build a page using Create React App, plus the sqlite3 module. In their default configurations, the two things don't seem to be compatible out of the box. I'm new to React and JS in general, so I'm hoping there's something obvious I'm missing here.</p>
  
  <p>Using npx v6.9.0 and Node v12.4.0, I can reproduce this by typing <code>npx create-react-app test</code>, <code>cd test</code>, <code>npm start</code>.</p>
  
  <p>So far so good. I type: <code>npm install sqlite3</code>, and receive an npm warning that I should install typescript. OK, I type <code>npm install typescript</code>. All good. I start up the app, and it compiles so far. Great!</p>
  
  <p>I open up App.js, and per sqlite3's readme doc, under the <code>import</code> lines, I type <code>var sqlite3 = require('sqlite3').verbose();</code></p>
  
  <p>This is probably where I'm doing something wrong. My app now fails to compile, telling me:</p>
  
  <pre><code>./node_modules/sqlite3/node_modules/node-pre-gyp/lib/info.js
  Module not found: Can't resolve 'aws-sdk' in '/Users/brendanlandis/Desktop/test/node_modules/sqlite3/node_modules/node-pre-gyp/lib'
  </code></pre>
  
  <p>I try <code>npm install aws-sdk</code>, which gets me a little farther. My app still won't compile, but now the error is:</p>
  
  <pre><code>TypeError: stream is undefined
  ./node_modules/set-blocking/index.js/&lt;/module.exports/&lt;
  node_modules/set-blocking/index.js:3
  
    1 | module.exports = function (blocking) {
    2 |   [process.stdout, process.stderr].forEach(function (stream) {
  &gt; 3 |     if (stream._handle &amp;&amp; stream.isTTY &amp;&amp; typeof stream._handle.setBlocking === 'function') {
    4 |       stream._handle.setBlocking(blocking);
    5 |     }
    6 |   });
  </code></pre>
  
  <p>In googling around, I haven't yet figured out what I'm doing wrong. Any help would be appreciated. Thanks!</p>