title: TypeScript error: Cannot find module 'moment'
body: <p>I have a TypeScript React app using <code>npx create-react-app --template typescript</code>. When I run <code>npm start</code>, I get an error in one of my files:</p>
  
  <pre><code>TypeScript error in /&lt;path&gt;/App.tsx:
  Cannot find module 'moment'.  TS2307
  </code></pre>
  
  <p>Import:</p>
  
  <pre><code>import moment from 'moment'
  </code></pre>
  
  <p>tsconfig.json</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es5",
      "lib": ["dom", "dom.iterable", "esnext"],
      "allowJs": false,
      "skipLibCheck": true,
      "esModuleInterop": true,
      "allowSyntheticDefaultImports": true,
      "strict": true,
      "forceConsistentCasingInFileNames": true,
      "module": "esnext",
      "moduleResolution": "node",
      "resolveJsonModule": true,
      "isolatedModules": true,
      "noEmit": true,
      "jsx": "react",
      "noImplicitAny": false,
      "experimentalDecorators": true
    },
    "include": ["src", "husky.config.js", "lint-staged.config.js"]
  }
  
  </code></pre>
  
  <p>Using <code>"moment": "^2.25.0"</code> in <code>package.json</code>. Using npm.</p>
  
  <p>Looking in the <code>node_modules</code> directory, I can see the <code>moment</code> package, and the <code>package.json</code> file says <code>moment</code> is on version 2.25.0</p>
  
  <p>I've tried clearing npm cache, deleting <code>node_modules</code> and <code>package-lock.json</code>, reinstalling, importing like <code>import * as moment from 'moment'</code>.</p>
  
  <p>Any ideas? This just randomly started happening today. Thanks in advance.</p>